Skip to content

Commit

Permalink
A more reliable method to get the global object
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jun 11, 2014
1 parent 4a53706 commit ceeb51c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@
return rejectsRegex;
};

/*jshint evil: true */
var getGlobal = new Function('return this;');
/*jshint evil: false */

var main = function() {
var globals = (typeof global === 'undefined') ? self : global;
var globals = getGlobal();
var global_isFinite = globals.isFinite;
var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported();
var startsWithIsCompliant = startsWithRejectsRegex();
Expand Down

0 comments on commit ceeb51c

Please sign in to comment.