Update ES6 scripted proxies "ownKeys" to ES6 final

RESOLVED FIXED in Firefox 42

Status

()

Core
JavaScript Engine
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: jorendorff, Assigned: evilpie)

Tracking

({dev-doc-complete})

unspecified
mozilla42
x86_64
Linux
dev-doc-complete
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

4 years ago
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>.
(Assignee)

Updated

4 years ago
Blocks: 978228
No longer blocks: 694100
(Assignee)

Comment 1

4 years ago
Created attachment 8536226 [details] [diff] [review]
WIP

I tried to optimize step 21 and 23, which makes this a bit harder to understand. The rest is basically spec copying.
(Assignee)

Updated

4 years ago
Duplicate of this bug: 798299
(Assignee)

Updated

3 years ago
Duplicate of this bug: 1176198
(Assignee)

Updated

3 years ago
Duplicate of this bug: 1176199
(Assignee)

Updated

3 years ago
Assignee: nobody → evilpies
(Assignee)

Updated

3 years ago
Attachment #8536226 - Attachment is obsolete: true
Keywords: dev-doc-needed
(Assignee)

Comment 5

3 years ago
Created attachment 8627844 [details] [diff] [review]
Reimplement Proxy's ownKeys
Attachment #8627844 - Flags: review?(efaustbmo)

Comment 6

3 years ago
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+
(Assignee)

Updated

3 years ago
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
Last Resolved: 3 years ago
status-firefox42: --- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
(Assignee)

Updated

3 years ago
Blocks: 1186133
You need to log in before you can comment on or make changes to this bug.