Bug 154665 - [ES6] for...in iteration doesn't comply with the specification
Summary: [ES6] for...in iteration doesn't comply with the specification
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks: 154650
  Show dependency treegraph
 
Reported: 2016-02-24 20:53 PST by Saam Barati
Modified: 2016-02-25 16:16 PST (History)
10 users (show)

See Also:


Attachments
patch (11.16 KB, patch)
2016-02-25 15:28 PST, Saam Barati
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-02-24 20:53:31 PST
Specifically, the has_*_property call JSObject::hasProperty
instead of JSObject::hasOwnProperty (which is essentially calling [[GetOwnProperty]]).

see the specification:
https://tc39.github.io/ecma262/#sec-enumerate-object-properties
Comment 1 Saam Barati 2016-02-25 14:36:49 PST
(In reply to comment #0)
> Specifically, the has_*_property call JSObject::hasProperty
> instead of JSObject::hasOwnProperty (which is essentially calling
> [[GetOwnProperty]]).
> 
> see the specification:
> https://tc39.github.io/ecma262/#sec-enumerate-object-properties

This assessment isn't quite right.
We want to process over the entire prototype chain
like hasProperty does, but we want to perform [[GetOwnProperty]]
and not [[HasProperty]].
Comment 2 Saam Barati 2016-02-25 15:28:14 PST
Created attachment 272252 [details]
patch
Comment 3 Michael Saboff 2016-02-25 15:35:29 PST
Comment on attachment 272252 [details]
patch

r=me
Comment 4 Saam Barati 2016-02-25 16:16:24 PST
landed in:
http://trac.webkit.org/changeset/197144