You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Enable win.eval hook
2. Execute evel within the context of a function, not a window, and reference
variables that are only valid within the function context
What is the expected output? What do you see instead?
eval command should work
What version of the product are you using? On what operating system?
eval is executed within the context of the window
Please provide any additional information below.
function x() {
var y = 1;
try {
eval("y++");
} catch(e) {}
}
var z = new x();
Not sure if the try/catch block or function creation matters.
Original issue reported on code.google.com by megazzt on 22 Jun 2011 at 3:07
The text was updated successfully, but these errors were encountered:
Hi, this is a known issue due to eval having some magic properties with respect
to scope. I've written a bit more detailed blog post on the topic here:
http://radi.r-n-d.org/2011/02/evil-magic-of-eval.html
Ew yeah I get that; I actually noticed some of that myself when working with
eval() (I do not use it myself, but it seems some of my coworkers are fond of
it).
I think I even tried to override the context of eval once and realized I
couldn't do it.
What you guys need to do is write a JS engine in JS and then use it for eval().
;) Problem solved!
Original comment by megazzt on 23 Jun 2011 at 7:13
Original issue reported on code.google.com by
megazzt
on 22 Jun 2011 at 3:07The text was updated successfully, but these errors were encountered: