all files / node_modules/webpack/buildin/ global.js

81.82% Statements 9/11
70.59% Branches 12/17
100% Functions 3/3
77.78% Lines 7/9
2 statements, 2 functions, 7 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                                  
var g;
 
// This works in non-strict mode
g = (function() {
	return this;
})();
 
try {
	// This works if eval is allowed (see CSP)
	g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
	// This works if the window reference is available
	if(typeof window === "object")
		g = window;
}
 
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
 
module.exports = g;