-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest 0.5.x: eval strict function and new expression #439
Comments
OK, it's nevertheless issue of This works (file var code = `
var foo = {m: 1};
function bar() {
"use strict";
return foo;
}
`;
eval(code);
bar(); Node session:
This doesn't: function main() {
var code = `
var foo = {m: 1};
function bar() {
"use strict";
return foo;
}
`;
eval(code);
bar(); // foo is not defined
}
main(); Node session:
Unless I'm missing something obvious from strict mode, it's probably a bug in |
The exact same script source is passed to I repro'd your latest results where the same error occurs with both Another thing I noticed was that after the |
Need to notice, this is test form io.js Also, if no |
OK, I filed this issue on |
This seems like it was fixed in node 4. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
With
vm.runInContext
and jsdom 5.4.3, we started to getReferenceError
issues:Thus it relates only to
"use strict"
inside the function, without it,_bar
is available in thenew foo()
call.The
vm.runInContext
seems works fine in isolation in this case. Can be jsdom related?CC @ide, @domenic
The text was updated successfully, but these errors were encountered: