Bug 140605 - ES6: Support Array.of construction
Summary: ES6: Support Array.of construction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords:
: 131699 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-18 21:29 PST by Dean Jackson
Modified: 2015-11-12 21:54 PST (History)
2 users (show)

See Also:


Attachments
Patch (9.01 KB, patch)
2015-01-18 21:42 PST, Dean Jackson
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***