Closed
Bug 1008441
Opened 10 years ago
Closed 10 years ago
Object.defineProperty(proxy, desc) parses desc twice
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: jorendorff, Assigned: jorendorff)
References
Details
Attachments
(1 file, 2 obsolete files)
6.69 KB,
patch
|
efaust
:
review+
|
Details | Diff | Splinter Review |
The first time when js::DefineOwnProperty calls PropDesc::initialize. The second time when js::DefineProperty calls Proxy::defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v) This is observable using standard ES6 library features, since the descriptor may also be a proxy. (More to the point, this means you can't call js::DefineProperty passing a PropDesc that doesn't have an initialized pd_ field for Proxy::defineProperty to redundantly parse. Since I want to do that for Array.from, I have to fix this bug.)
Assignee | ||
Comment 1•10 years ago
|
||
That Proxy::defineProperty signature turns out to be used only in these two places, so delete it.
Assignee: nobody → jorendorff
Attachment #8420400 -
Flags: review?(jwalden+bmo)
Comment 2•10 years ago
|
||
Comment on attachment 8420400 [details] [diff] [review] bug-1008441-PropDesc-twice-v1.patch Review of attachment 8420400 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jsobj.cpp @@ +223,5 @@ > + if (!hasConfigurable() || !configurable()) > + attrs |= JSPROP_PERMANENT; > + if (hasEnumerable() && enumerable()) > + attrs |= JSPROP_ENUMERATE; > + if (!hasWritable() || !hasWritable()) Change to `!hasWritable() || !writable()` ?
Assignee | ||
Comment 3•10 years ago
|
||
Uh. Wow. How did I manage to write that? Good catch.
Assignee | ||
Comment 4•10 years ago
|
||
Actually, even with hasWritable(), that line was busted. We must not set JSPROP_READONLY if the descriptor is an accessor descriptor.
Attachment #8420400 -
Attachment is obsolete: true
Attachment #8420400 -
Flags: review?(jwalden+bmo)
Attachment #8425777 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 5•10 years ago
|
||
Rebased on top of Eric's patches in bug 978238, which contain the populatePropertyDescriptor method I'm using... bumping review to Eric too.
Attachment #8430383 -
Flags: review?(efaustbmo)
Assignee | ||
Updated•10 years ago
|
Attachment #8425777 -
Attachment is obsolete: true
Attachment #8425777 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 6•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=c64a8769add5
Comment 7•10 years ago
|
||
Comment on attachment 8430383 [details] [diff] [review] bug-1008441-PropDesc-twice-v3.patch Review of attachment 8430383 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Thanks for doing this. r=me
Attachment #8430383 -
Flags: review?(efaustbmo) → review+
Assignee | ||
Comment 8•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3825abd9a302
Comment 9•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3825abd9a302
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•