Bug 154665

Summary: [ES6] for...in iteration doesn't comply with the specification
Product: WebKit Reporter: Saam Barati <sbarati>
Component: JavaScriptCoreAssignee: Saam Barati <sbarati>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, fpizlo, ggaren, gskachkov, keith_miller, mark.lam, msaboff, oliver, sukolsak, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 154650    
Attachments:
Description Flags
patch msaboff: review+

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