Closed
Bug 1395095
Opened 8 years ago
Closed 8 years ago
MappedArgumentsObject::obj_defineProperty should not create slotful getters/setters
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla57
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file, 1 obsolete file)
|
2.63 KB,
patch
|
evilpies
:
review+
|
Details | Diff | Splinter Review |
I have a patch to remove JSPROP_SHARED and slotful getters/setters, but it fails some |arguments| tests.
The problem is that MappedArgumentsObject::obj_defineProperty unconditionally adds MappedArgGetter/MappedArgSetter, even if the descriptor has a different value. We were also missing a spec step (5.a.) - maybe that was added after we wrote this code?
With slotful getters/setters this currently just happens to work, but it's pretty complicated. This patch fixes all test failures.
Attachment #8902604 -
Flags: review?(evilpies)
| Assignee | ||
Comment 1•8 years ago
|
||
Comment on attachment 8902604 [details] [diff] [review]
Patch
Actually this is buggy still I think.
Attachment #8902604 -
Flags: review?(evilpies)
| Assignee | ||
Comment 2•8 years ago
|
||
This works better. I also added a test that failed with the previous patch.
Not all of the newArgDesc modifications are strictly necessary, but I think explicitly clearing the value or getter/setter makes it easier to understand.
Attachment #8902604 -
Attachment is obsolete: true
Attachment #8902619 -
Flags: review?(evilpies)
Comment 3•8 years ago
|
||
Comment on attachment 8902619 [details] [diff] [review]
Patch
Review of attachment 8902619 [details] [diff] [review]:
-----------------------------------------------------------------
I think this should work, but it's hard to be completely sure with this insanity.
::: js/src/vm/ArgumentsObject.cpp
@@ +656,4 @@
> if (!desc.isAccessorDescriptor() && isMapped) {
> + // Step 5.a.
> + if (desc.hasWritable() && !desc.writable()) {
> + if (!desc.hasValue()) {
This isn't really necessary in our implementation, but follows the spec.
Attachment #8902619 -
Flags: review?(evilpies) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c3094f515e80
Fix MappedArgumentsObject::obj_defineProperty to not create slotful getters/setters. r=evilpie
Comment 5•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•