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

Issue 553413002: Array.prototype.{every, filter, find, findIndex, forEach, map, some}: Use fresh primitive wrapper f… (Closed)

Created:
6 years, 3 months ago by Diego Pino
Modified:
6 years, 2 months ago
CC:
v8-dev, aperez, vjaquez, gemont_igalia.com
Project:
v8
Visibility:
Public.

Description

Array.prototype.{every, filter, find, findIndex, forEach, map, some}: Use fresh primitive wrapper for calls. When the receiver is a primitive value, it's cast to an Object before entering the loop. Instead, it should be cast to an Object for each function call while in the loop. BUG=v8:3536 LOG=Y R=arv@chromium.org, svenpanne@chromium.org, wingo@igalia.com Committed: https://code.google.com/p/v8/source/detail?r=24620

Patch Set 1 #

Patch Set 2 : Apply same changes to MapForEach and SetForEach #

Total comments: 15

Patch Set 3 : Created wrapper. Added tests for strict mode. Fixed nits. #

Total comments: 8

Patch Set 4 : Fix last issues. #

Total comments: 4

Patch Set 5 : Fixed last issues #

Total comments: 1

Patch Set 6 : Remove unnecessary is_null_or_undefined check #

Total comments: 3

Patch Set 7 : Fixed nits from last patch. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+230 lines, -23 lines) Patch
M src/array.js View 1 2 3 4 10 chunks +25 lines, -15 lines 0 comments Download
M src/collection.js View 1 2 3 4 3 chunks +16 lines, -2 lines 0 comments Download
M src/harmony-array.js View 1 2 3 4 2 chunks +10 lines, -6 lines 0 comments Download
M src/macros.py View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M test/mjsunit/array-iteration.js View 1 2 3 4 5 6 5 chunks +85 lines, -0 lines 0 comments Download
M test/mjsunit/es6/collections.js View 1 2 3 4 5 6 2 chunks +57 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/array-find.js View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/array-findindex.js View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (4 generated)
aperez
On 2014/09/10 11:22:12, Diego Pino wrote: > mailto:dpino@igalia.com changed reviewers: > + mailto:aperez@igalia.com, mailto:ceyusa@gmail.com, mailto:gemont@igalia.com, ...
6 years, 3 months ago (2014-09-10 12:25:48 UTC) #2
aperez
On 2014/09/10 12:25:48, aperez wrote: > On 2014/09/10 11:22:12, Diego Pino wrote: > > mailto:dpino@igalia.com ...
6 years, 3 months ago (2014-09-10 12:28:12 UTC) #3
aperez
On 2014/09/10 12:28:12, aperez wrote: > On 2014/09/10 12:25:48, aperez wrote: > > On 2014/09/10 ...
6 years, 3 months ago (2014-09-10 12:30:25 UTC) #4
arv (Not doing code reviews)
https://codereview.chromium.org/553413002/diff/20001/src/array.js File src/array.js (right): https://codereview.chromium.org/553413002/diff/20001/src/array.js#newcode1139 src/array.js:1139: if (!IS_NULL_OR_UNDEFINED(receiver) && Can this test be moved out ...
6 years, 3 months ago (2014-09-12 16:29:17 UTC) #6
mathias
Why do we need the `!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)` checks in the first place? I can’t ...
6 years, 3 months ago (2014-09-13 04:08:34 UTC) #7
arv (Not doing code reviews)
On 2014/09/13 04:08:34, mathias wrote: > Why do we need the `!IS_SPEC_OBJECT(receiver) && %IsSloppyModeFunction(f)` > ...
6 years, 3 months ago (2014-09-14 16:31:09 UTC) #8
wingo
https://codereview.chromium.org/553413002/diff/20001/src/collection.js File src/collection.js (right): https://codereview.chromium.org/553413002/diff/20001/src/collection.js#newcode268 src/collection.js:268: if (!IS_NULL_OR_UNDEFINED(receiver)) { Same comment here as Erik's comment ...
6 years, 3 months ago (2014-09-15 09:12:21 UTC) #9
Diego Pino
6 years, 3 months ago (2014-09-16 10:08:29 UTC) #11
Diego Pino
https://codereview.chromium.org/553413002/diff/20001/src/array.js File src/array.js (right): https://codereview.chromium.org/553413002/diff/20001/src/array.js#newcode1139 src/array.js:1139: if (!IS_NULL_OR_UNDEFINED(receiver) && On 2014/09/12 16:29:17, arv wrote: > ...
6 years, 3 months ago (2014-09-16 10:45:46 UTC) #12
wingo
https://codereview.chromium.org/553413002/diff/20001/src/array.js File src/array.js (right): https://codereview.chromium.org/553413002/diff/20001/src/array.js#newcode1139 src/array.js:1139: if (!IS_NULL_OR_UNDEFINED(receiver) && On 2014/09/16 10:45:46, Diego Pino wrote: ...
6 years, 3 months ago (2014-09-16 12:04:04 UTC) #13
wingo
On 2014/09/16 10:45:46, Diego Pino wrote: > The reason of IsSloppyModeFunction(f) is that according to ...
6 years, 3 months ago (2014-09-16 12:06:20 UTC) #14
wingo
Looking good, just a few comments https://codereview.chromium.org/553413002/diff/40001/src/array.js File src/array.js (right): https://codereview.chromium.org/553413002/diff/40001/src/array.js#newcode1413 src/array.js:1413: var element = ...
6 years, 3 months ago (2014-09-23 18:39:02 UTC) #15
Diego Pino
https://codereview.chromium.org/553413002/diff/40001/src/array.js File src/array.js (right): https://codereview.chromium.org/553413002/diff/40001/src/array.js#newcode1413 src/array.js:1413: var element = array[i]; On 2014/09/23 18:39:01, wingo wrote: ...
6 years, 3 months ago (2014-09-24 10:13:01 UTC) #16
wingo
Some comments. https://codereview.chromium.org/553413002/diff/60001/src/harmony-array.js File src/harmony-array.js (right): https://codereview.chromium.org/553413002/diff/60001/src/harmony-array.js#newcode30 src/harmony-array.js:30: thisArg = %GetDefaultthisArg(predicate) || thisArg; Typo. Did ...
6 years, 2 months ago (2014-09-30 16:01:36 UTC) #17
Diego Pino
Uploaded new patch. PTAL. On 2014/09/30 16:01:36, wingo wrote: > Some comments. > > https://codereview.chromium.org/553413002/diff/60001/src/harmony-array.js ...
6 years, 2 months ago (2014-09-30 16:35:15 UTC) #18
wingo
One nit -- can you recheck that tests pass after fixing? https://codereview.chromium.org/553413002/diff/80001/src/macros.py File src/macros.py (right): ...
6 years, 2 months ago (2014-09-30 16:41:12 UTC) #19
Diego Pino
On 2014/09/30 16:41:12, wingo wrote: > One nit -- can you recheck that tests pass ...
6 years, 2 months ago (2014-09-30 16:45:18 UTC) #20
wingo
LGTM, please add an OWNER
6 years, 2 months ago (2014-09-30 16:46:06 UTC) #21
Diego Pino
Could you please take a look? Thanks :)
6 years, 2 months ago (2014-09-30 16:49:46 UTC) #23
Diego Pino
Sven Panne: "git cl owner" suggested me you as an owner. The issue is already ...
6 years, 2 months ago (2014-10-12 19:18:59 UTC) #24
Sven Panne
On 2014/10/12 19:18:59, Diego Pino wrote: > Sven Panne: "git cl owner" suggested me you ...
6 years, 2 months ago (2014-10-14 10:28:51 UTC) #25
arv (Not doing code reviews)
LGTM with nits https://codereview.chromium.org/553413002/diff/100001/test/mjsunit/array-iteration.js File test/mjsunit/array-iteration.js (right): https://codereview.chromium.org/553413002/diff/100001/test/mjsunit/array-iteration.js#newcode80 test/mjsunit/array-iteration.js:80: assertFalse(a[0] !== a[1]); assertEquals https://codereview.chromium.org/553413002/diff/100001/test/mjsunit/array-iteration.js#newcode85 test/mjsunit/array-iteration.js:85: ...
6 years, 2 months ago (2014-10-14 15:55:33 UTC) #26
Sven Panne
LGTM (rubberstamped) when nits are addressed
6 years, 2 months ago (2014-10-15 06:11:52 UTC) #27
Diego Pino
Nits fixed in last patch.
6 years, 2 months ago (2014-10-15 07:48:27 UTC) #28
Sven Panne
Landing it for you...
6 years, 2 months ago (2014-10-15 09:04:23 UTC) #29
Sven Panne
6 years, 2 months ago (2014-10-15 09:11:47 UTC) #30
Message was sent while issue was closed.
Committed patchset #7 (id:130001) manually as 24620 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698