[Webkit-unassigned] [Bug 202139] Object spread ({ ... } syntax): object key order is modified

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 24 23:03:39 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=202139

--- Comment #3 from Kevin Gibbons <bakkot at gmail.com> ---
Unfortunately, just deleting the relevant

object->methodTable(vm)->deleteProperty(object, exec, propertyName)

line in validateAndApplyPropertyDescriptor causes

Object.getOwnPropertyDescriptor(Object.defineProperty({ a: 0 }, 'a', { value: 1, enumerable: false }), 'a').enumerable

to start returning `true` instead of `false`, so some more complex solution will be necessary to allow updating the attributes of an existing property without first deleting it.

---

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.)

-- 
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/20190925/dcd3db5e/attachment.html>


More information about the webkit-unassigned mailing list