Closed Bug 1133085 Opened 9 years ago Closed 9 years ago

PropDesc::initFromPropertyDescriptor fills in get or set if only the other is present

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: jorendorff, Assigned: jorendorff)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

That is: if the PropertyDescriptor has just JSPROP_SETTER, the resulting PropDesc will have both .hasGet() and .hasSet() true. It's observable from script:


var p = new Proxy({}, {
    defineProperty(t, k, desc) {
        assertEq("get" in desc, false);  // FAILS
    }
});
Object.defineProperty(p, "x", {set: function () {}});
PropDesc and PropertyDescriptor are at last capable of expressing all valid PropertyDescriptors, both complete and incomplete. This should make them pretty much equivalent. But since this came on gradually, there is a lingering bug in the code that translates between the two structs.
Attachment #8565091 - Flags: review?(efaustbmo)
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
Comment on attachment 8565091 [details] [diff] [review]
Fix for PropDesc::initFromPropertyDescriptor

Review of attachment 8565091 [details] [diff] [review]:
-----------------------------------------------------------------

Sure. This makes sense in light of everything else.
Attachment #8565091 - Flags: review?(efaustbmo) → review+
https://hg.mozilla.org/mozilla-central/rev/2bc1b90f74a7
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: