Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Issue 16848004: ES6: Array iterator methods (Closed)

Created:
7 years, 6 months ago by arv (Not doing code reviews)
Modified:
7 years, 5 months ago
Reviewers:
wingo, rossberg
CC:
v8-dev
Visibility:
Public.

Description

This adds the following array iterator methods: Array.prototype.values Array.prototype.keys Array.prototype.entries These all return an Array Iterator object which has a next method. http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.4.5 BUG=v8:2722

Patch Set 1 #

Total comments: 6

Patch Set 2 : Code review feedback #

Patch Set 3 : Add for-of tests #

Patch Set 4 : Use %CreateSymbol instead #

Unified diffs Side-by-side diffs Delta from patch set Stats (+329 lines, -1 line) Patch
A src/array-iterator.js View 1 2 3 1 chunk +127 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/array-iterator.js View 1 2 3 1 chunk +195 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
arv (Not doing code reviews)
Feedback wanted. This implements Array.prototype.{values,keys,entries} It currently depends on Symbol for the private state. Is ...
7 years, 6 months ago (2013-06-12 21:45:32 UTC) #1
wingo
Very cool! Regarding the iterator state: why not use a closure instead? I find publically ...
7 years, 6 months ago (2013-06-13 04:26:18 UTC) #2
rossberg
On 2013/06/12 21:45:32, arv wrote: > Feedback wanted. > > This implements Array.prototype.{values,keys,entries} > > ...
7 years, 6 months ago (2013-06-13 08:21:47 UTC) #3
rossberg
https://codereview.chromium.org/16848004/diff/1/src/array-iterator.js File src/array-iterator.js (right): https://codereview.chromium.org/16848004/diff/1/src/array-iterator.js#newcode72 src/array-iterator.js:72: Nit: duplicated empty line https://codereview.chromium.org/16848004/diff/1/test/mjsunit/harmony/array-iterator.js File test/mjsunit/harmony/array-iterator.js (right): https://codereview.chromium.org/16848004/diff/1/test/mjsunit/harmony/array-iterator.js#newcode29 ...
7 years, 6 months ago (2013-06-13 08:22:02 UTC) #4
rossberg
On 2013/06/13 04:26:18, wingo wrote: > Regarding the iterator state: why not use a closure ...
7 years, 6 months ago (2013-06-13 08:23:27 UTC) #5
arv (Not doing code reviews)
Yeah, the spec requires next to be a method on the prototype so we need ...
7 years, 6 months ago (2013-06-13 13:54:27 UTC) #6
arv (Not doing code reviews)
Sorry for letting this sit so long. Cleaned up to not depend on --harmony-symbols. It ...
7 years, 5 months ago (2013-07-08 22:03:16 UTC) #7
rossberg
LGTM, will land On 2013/07/08 22:03:16, arv wrote: > Sorry for letting this sit so ...
7 years, 5 months ago (2013-07-09 13:03:39 UTC) #8
rossberg
7 years, 5 months ago (2013-07-11 11:32:19 UTC) #9
Committed, but that wasn't propagated here, because I hit Ctrl-C when I noticed
that I had forgotten the committer flag. But was too late already, sorry about
that!

Powered by Google App Engine
This is Rietveld 408576698