[Webkit-unassigned] [Bug 14163] declared variable in window.eval statement not preserved after return from calling context
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Dec 30 06:57:46 PST 2007
http://bugs.webkit.org/show_bug.cgi?id=14163
qomo.team at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
------- Comment #12 from qomo.team at gmail.com 2007-12-30 06:57 PDT -------
There seems to be some kind of misunderstanding, take a look at the original
test case:
function f()
{
window.eval('test1=1', 'JavaScript');
window.eval('var test2=2', 'JavaScript');
alert(test1);
alert(test2);
}
f();
---------
By declaring either with or without "var", both of them is available in the
context of function f() (thus two alert dialog with "1" and "2" showed).
---------
alert(test1);
alert(test2);
---------
And then, after function f() ends, the test1 exsist, BUT test2 disappeared!
This is different from what IE's execScript() and Gecko's eval() with syntax
"window.eval(script);" does.
(the other ways in Gecko such like "window.eval(script, lang);" "eval(script)"
has the bug same as what described here, with even worse effects such as
leading a crash. But they seems not going to resolve that, referenced as
https://bugzilla.mozilla.org/show_bug.cgi?id=352045).
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list