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

Enable requiring modules that rely on strict mode. #16

Closed
wants to merge 1 commit into from

Conversation

tristanls
Copy link

This is my solution to a problem where I wanted to sandbox a module that used ES6 Harmony features such as let.

I can now enable v8 "extended mode" by running tests using --harmony flag and requiring sandboxed modules with "use strict"; by providing strictMode : true options when requiring.

@domenic
Copy link
Collaborator

domenic commented Jan 2, 2013

Hmm yeah so obviously we have a bug; if the original module is strict, the sandboxed one should be also. But this is not the correct solution.

I guess the issue is the line:

'global = GLOBAL = root = (function() { return this; })();' +

which is interfering with the pragma's positioning rules.

You should be able to move global, GLOBAL, and root (is that a real thing?) into localVariables instead, to get the desired behavior.

Also, a test would be nice :).

Thanks!

@domenic domenic closed this Jan 2, 2013
@tristanls
Copy link
Author

Fair enough, I did take the shortest path :D. At least it's documented now.

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

2 participants