Reorder property creation in js::FromPropertyDescriptorToObject

RESOLVED FIXED in Firefox 40

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: anba, Assigned: evilpie)

Tracking

(Blocks 2 bugs)

Trunk
mozilla40
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

More or less the same as bug 737198, except Object.getOwnPropertyNames instead of Object.keys is used, and ES2015 specifies to preserve property creation order.

Object.getOwnPropertyNames(Object.getOwnPropertyDescriptor({foo: 0}, "foo"))

Expected: [ "value", "writable", "enumerable", "configurable" ]
Actual: [ "configurable", "enumerable", "value", "writable" ]


Object.getOwnPropertyNames(Object.getOwnPropertyDescriptor({get foo(){}}, "foo"))

Expected: [ "get", "set", "enumerable", "configurable" ]
Actual: [ "configurable", "enumerable", "get", "set" ]


ES2015:
6.2.4.4 FromPropertyDescriptor
9.1.12 [[OwnPropertyKeys]] ( )
19.1.2.8.1 Runtime Semantics: GetOwnPropertyKeys ( O, Type )
Blocks: es6
Assignee: nobody → evilpies
Attachment #8597610 - Flags: review?(jwalden+bmo)
Comment on attachment 8597610 [details] [diff] [review]
v1 - Use the right property order in FromPropertyDescriptor

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

::: js/src/tests/ecma_6/Object/property-descriptor-order.js
@@ +11,5 @@
> +        return true;
> +    }
> +});
> +
> +Object.defineProperty(proxy, "foo", {set: function() {}, configurable: true});

Put configurable first, then set second, here -- to verify that we've gone through FromPropertyDescriptor or so here, and aren't simply transliterating directly from the descriptor object provided to Object.defineProperty.
Attachment #8597610 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/a240e100cb2a
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.