Closed
Bug 1085566
Opened 10 years ago
Closed 10 years ago
Make the preventExtensions hook return succeeded/failed rather than always indicate failure by reporting an error
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: Waldo, Assigned: Waldo)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
31.56 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
This'll be necessary to implement Reflect.preventExtensions, eventually, and the current signature is misleading people as to how this hook should work.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8508143 -
Flags: review?(efaustbmo)
Comment 2•10 years ago
|
||
Comment on attachment 8508143 [details] [diff] [review] Patch Review of attachment 8508143 [details] [diff] [review]: ----------------------------------------------------------------- r=me with return value changed. Glad to see the stupidity in the SDPH method go away, and us get closer to spec. ::: dom/base/nsGlobalWindow.cpp @@ +727,1 @@ > return false; This should now return true, no? This doesn't actually throw, just "recommends throwing to the caller", right? As written, this is likely to assert on a JS_ASSERT_IF(!ok, cx->pendingException) or some such, I would think
Attachment #8508143 -
Flags: review?(efaustbmo) → review+
Assignee | ||
Comment 3•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e900e87b4bb https://hg.mozilla.org/integration/mozilla-inbound/rev/e1f3364485a1 Second patch is a test for this. It's mostly invisible, but if you try to do Object.preventExtensions on a cross-compartment wrapper to a proxy that sets the outparam to false but doesn't return false, the compartment of the throw exception differs, pre- and post-patch. There are a few other little flourishes I want to do to the preventExtensions hooks (mostly make the ones that should flat-out throw, that I didn't think to make do it here, do so again). I'll file a new bug with that patch.
Comment 4•10 years ago
|
||
Hi Waldo, sorry had to back this out in https://treeherder.mozilla.org/ui/#/jobs?repo=mozilla-inbound&revision=accd28c1aaa3 since one of this changes/bugs caused perma failures like https://treeherder.mozilla.org/ui/logviewer.html#?job_id=3198627&repo=mozilla-inbound
Assignee | ||
Comment 5•10 years ago
|
||
My suspicion is that IPC code requires outparams to be initialized even for failure cases. Retrying: https://tbpl.mozilla.org/?tree=Try&rev=cea02b701e36
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e1f3364485a1
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Assignee | ||
Comment 7•10 years ago
|
||
Relanded the backed-out part, with the missing |*succeeded = false;| (or true, doesn't matter as long as it's one of the two :-\ ) added to WrapperAnswer::RecvPreventExtensions: https://hg.mozilla.org/integration/mozilla-inbound/rev/7bfc7cabc457 (The bit in comment 6 is a test that landed separately from this, that doesn't run on main tinderbox displays and so wasn't backed out when this was backed out. ^-^ ) https://tbpl.mozilla.org/?tree=Try&rev=c179dacb0844 is a try run that was green wrt the one failure mentioned as responsible for the backout. The dt oranges there are from the pe-fup.diff patch there, that was *not* landed at this time. (Those are the "few other little flourishes" from comment 3, destined for another bug.)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7bfc7cabc457
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•10 years ago
|
||
Updated: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/38 https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_PreventExtensions (which apparently didn't exist before, bad us!) https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference
Keywords: dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•