Bug 140605

Summary: ES6: Support Array.of construction
Product: WebKit Reporter: Dean Jackson <dino>
Component: New BugsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ggaren: review+

Description Dean Jackson 2015-01-18 21:29:11 PST
ES6: Support Array.of construction
Comment 1 Dean Jackson 2015-01-18 21:29:51 PST
<rdar://problem/19513655>
Comment 2 Dean Jackson 2015-01-18 21:42:09 PST
Created attachment 244877 [details]
Patch
Comment 3 Geoffrey Garen 2015-01-19 10:53:33 PST
Comment on attachment 244877 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244877&action=review

r=me with two fixes below

> Source/JavaScriptCore/runtime/ArrayConstructor.cpp:55
> +  of        arrayConstructorOf          DontEnum|Function 1

Length should be 0, not 1.

> Source/JavaScriptCore/runtime/ArrayConstructor.cpp:139
> +        result->putDirectIndex(exec, i, args.at(i));

You should add a line to your testcase that verifies that Array.of does not invoke a setter for the index 0.
Comment 4 Eric Carlson 2015-01-19 10:57:41 PST
Comment on attachment 244877 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244877&action=review

> Source/JavaScriptCore/ChangeLog:9
> +        Add and implementation of Array.of, described in 22.1.2.3 of the ES6

Nit: "Add and" -> "Add an"
Comment 5 Dean Jackson 2015-01-19 13:40:41 PST
Committed r178662: <http://trac.webkit.org/changeset/178662>
Comment 6 Dean Jackson 2015-01-19 13:41:32 PST
(In reply to comment #4)
> 
> Nit: "Add and" -> "Add an"

Oops!
Comment 7 Joseph Pecoraro 2015-11-12 21:54:28 PST
*** Bug 131699 has been marked as a duplicate of this bug. ***