[Webkit-unassigned] [Bug 202139] Object spread ({ ... } syntax): object key order is modified
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Aug 30 04:27:42 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=202139
Alexey Shvayka <shvaikalesh at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |shvaikalesh at gmail.com
Resolution|--- |DUPLICATE
--- Comment #6 from Alexey Shvayka <shvaikalesh at gmail.com> ---
(In reply to Kevin Gibbons from comment #2)
> which is the bug: it changes the order in which properties appear to have
> been added to the object, which is observable with Reflect.ownKeys. I don't
> know why it does that delete.
Thank you Kevin for super-detailed investigation!
r264574 replaces deleteProperty() calls in validateAndApplyPropertyDescriptor() with attribute-change transition, fixing the object spread order and the following test cases:
(In reply to Kevin Gibbons from comment #3)
> Also, note that any fix to this will require making all of
>
> Reflect.ownKeys(Object.defineProperty({ a: 0, b: 0 }, 'a', { enumerable:
> false }))
> Reflect.ownKeys(Object.defineProperty({ a: 0, b: 0 }, 'a', { get: () => 0 }))
> Reflect.ownKeys(Object.defineProperty(Object.create(null, { a: { get: () =>
> {}, configurable: true }, b: { get: () => {}, configurable: true } }), 'a',
> { value: 1 }))
> Reflect.ownKeys(Object.defineProperty(Object.create(null, { a: { get: () =>
> {}, configurable: true }, b: { get: () => {}, configurable: true } }), 'a',
> { get: () => {} }))
>
> return `["a","b"]` as well. (There are four distinct deleteProperty calls in validateAndApplyPropertyDescriptor, each of which needs to be avoided to preserve property enumeration order.)
Test262 coverage: https://github.com/tc39/test262/pull/2516.
*** This bug has been marked as a duplicate of bug 142933 ***
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200830/e82491f8/attachment.htm>
More information about the webkit-unassigned
mailing list