Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A more reliable method to get the global object #259

Merged
merged 1 commit into from
Jun 12, 2014

Conversation

ljharb
Copy link
Collaborator

@ljharb ljharb commented Jun 11, 2014

Fixes #258.

This uses eval via the Function constructor, which is awful, but I can't come up with a better method in strict mode. I could also do (function () { return this; }()) in non-strict mode, but then I'd have to make the outer wrapper of the shim not be in strict mode.

@ljharb
Copy link
Collaborator Author

ljharb commented Jun 11, 2014

@david-risney, can you test this pr in a web worker, and confirm that it still works?
@tavwizard, can you test this pr in node-webkit, and confirm that it now works?

@david-risney
Copy link
Contributor

Yep, looks good. I ran the worker test I had added with my previous change and it continues to pass with your change.

ljharb added a commit that referenced this pull request Jun 12, 2014
A more reliable method to get the global object
@ljharb ljharb merged commit 36711a4 into paulmillr:master Jun 12, 2014
@tavwizard
Copy link

work fine under node-webkit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants