Closed
Bug 600287
Opened 14 years ago
Closed 14 years ago
Indirect eval should use callee's global, not the this-argument
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Assigned: jorendorff)
Details
(Whiteboard: [fixed-in-tracemonkey])
Attachments
(1 file)
3.67 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
<jorendorff> dherman, mrbkap, Waldo, brendan: Suppose you have lots of global objects... should indirect eval, as in window.open(url).eval(s), use the current global? or its parent? <jorendorff> ES5 just says "the global object" <dherman> ES5 maintains the single-global-object fiction, yeah [...] <brendan> jorendorff: eval's parent I think so too.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee: general → jorendorff
Attachment #479118 -
Flags: review?(brendan)
Comment 2•14 years ago
|
||
Comment on attachment 479118 [details] [diff] [review] v1 Nice, but can you remind me of the bug for getting rid of the EvalError throw and cite it in a FIXME in the code you're moving and reindenting? Thanks, /be
Attachment #479118 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 3•14 years ago
|
||
I was surprised to find that I had already done exactly that in v1! But my wording was unclear. Here's how I rewrote it for checkin: /* * Ban indirect uses of eval (nonglobal.eval = eval; nonglobal.eval(....)) * that attempt to use a non-global object as the scope object. * * This ban is a bit silly, since we could just disregard the this-argument * entirely. In fact ES5 apparently requires us to do so; see bug 592664. */ http://hg.mozilla.org/tracemonkey/rev/60b9a07d3d29
Whiteboard: [fixed-in-tracemonkey]
Comment 4•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/60b9a07d3d29
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•