Closed
Bug 652803
Opened 13 years ago
Closed 13 years ago
[Harmony proxies] recursive fixing doesn't throw
Categories
(Core :: JavaScript Engine, defect, P2)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: tomvc.be, Assigned: jdm)
References
Details
(Whiteboard: [fixed-in-tracemonkey])
Attachments
(1 file, 1 obsolete file)
1.12 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
Recursively fixing a Harmony proxy should be short-circuited by throwing a TypeError, to safeguard against infinite loops. For instance: var proxy = Proxy.create({ fix: function() { Object.preventExtensions(proxy); // triggers 'fix()' recursively return {}; } }); Object.preventExtensions(proxy); // triggers 'fix' Result: InternalError: too much recursion Expected: a TypeError We reached consensus on this behavior in a TC39 meeting last year. Admittedly, it's well hidden on the semantics page: <http://wiki.ecmascript.org/doku.php?id=harmony:proxies_semantics> "Note: recursive fixing should be disallowed. If fix() is called on a proxy handler while the same proxy is already being fixed (an earlier call to fix() is already on the stack), a TypeError should be thrown. "
Reporter | ||
Updated•13 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•13 years ago
|
||
So it looks like the code to do this properly is already present, but in the wrong spot. I have no way of accessing tryserver or a recent tree, so this patch may not apply or be correct. If someone (gal?) could try applying it and see if it solves the problem, I would be mighty appreciative.
Attachment #528646 -
Flags: feedback?(gal)
Assignee | ||
Comment 3•13 years ago
|
||
Tested; this works correctly.
Assignee: general → josh
Attachment #528646 -
Attachment is obsolete: true
Attachment #528646 -
Flags: feedback?(gal)
Attachment #530403 -
Flags: review?(gal)
Comment 4•13 years ago
|
||
Comment on attachment 530403 [details] [diff] [review] Check proxy operations before fixing object. Nice patch. Thanks!
Attachment #530403 -
Flags: review?(gal) → review+
Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Whiteboard: [needs push to t-m]
Updated•13 years ago
|
Keywords: checkin-needed → 4xp
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [needs push to t-m] → [fixed in tracemonkey]
Comment 5•13 years ago
|
||
We need a regression test for this bug. http://hg.mozilla.org/tracemonkey/rev/6855db79531d does not include one.
Comment 6•13 years ago
|
||
cdleary-bot mozilla-central merge info: http://hg.mozilla.org/mozilla-central/rev/6855db79531d Note: not marking as fixed because fixed-in-tracemonkey is not present on the whiteboard.
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in tracemonkey] → [fixed-in-tracemonkey]
You need to log in
before you can comment on or make changes to this bug.
Description
•