Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit

Permalink
Simplify global object discovery technique added in #346.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Aug 3, 2018
1 parent bbfa640 commit e5425dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/regenerator-runtime/runtime-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This method of obtaining a reference to the global object needs to be
// kept identical to the way it is obtained in runtime.js
var g = (function() {
return this ? this : (typeof self !== 'undefined' ? self : undefined)
return this || (typeof self === "object" && self);
})() || Function("return this")();

// Use `getOwnPropertyNames` because not all browsers support calling
Expand Down
2 changes: 1 addition & 1 deletion packages/regenerator-runtime/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,6 @@
// Function constructor if we're in global strict mode. That is sadly a form
// of indirect eval which violates Content Security Policy.
(function() {
return this ? this : (typeof self !== 'undefined' ? self : undefined)
return this || (typeof self === "object" && self);
})() || Function("return this")()
);

0 comments on commit e5425dc

Please sign in to comment.