Closed Bug 1049662 Opened 10 years ago Closed 9 years ago

Update ES6 scripted proxies "ownKeys" to ES6 final

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: jorendorff, Assigned: evilpie)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

ES6 rev 25 and earlier did not do any checking of the result of "ownKeys" except to check that it was an Object.

We have always been much stricter than that. In ES6 rev 26, the spec has changed to treat the result as an arraylike and do some checking.

http://people.mozilla.org/~jorendorff/es6-draft.html#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys

We need to check that our existing code matches the new spec, and at least update the step number comments...

The new spec is still maybe a bit rough; see <https://bugs.ecmascript.org/show_bug.cgi?id=3108>.
Blocks: 978228
No longer blocks: es6
Attached patch WIP (obsolete) — Splinter Review
I tried to optimize step 21 and 23, which makes this a bit harder to understand. The rest is basically spec copying.
Assignee: nobody → evilpies
Attachment #8536226 - Attachment is obsolete: true
Attachment #8627844 - Flags: review?(efaustbmo)
Comment on attachment 8627844 [details] [diff] [review]
Reimplement Proxy's ownKeys

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

This looks great, Tom. Nice work.

::: js/src/proxy/ScriptedDirectProxyHandler.cpp
@@ -128,5 @@
>  }
>  
> -// Aux.6 IsSealed(O, P)
> -static bool
> -IsSealed(JSContext* cx, HandleObject obj, HandleId id, bool* bp)

Happy to see this go.

@@ -162,5 @@
>  
> -// This function is shared between ownPropertyKeys, enumerate, and
> -// getOwnEnumerablePropertyKeys.
> -static bool
> -ArrayToIdVector(JSContext* cx, HandleObject proxy, HandleObject target, HandleValue v,

Happy to see this go.
Attachment #8627844 - Flags: review?(efaustbmo) → review+
Summary: Update ES6 scripted proxies "ownKeys" to ES6 draft rev 26 → Update ES6 scripted proxies "ownKeys" to ES6 final
https://hg.mozilla.org/mozilla-central/rev/f68937aa6842
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Blocks: 1186133
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: