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

Issue 7044054: Fix Array.prototype.{reduce,reduceRight} to pass undefined as receiver (Closed)

Created:
9 years, 6 months ago by Mads Ager (chromium)
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Fix Array.prototype.{reduce,reduceRight} to pass undefined as receiver for strict mode callbacks. Propagate strict mode information from pre-parser to parser for lazily compiled functions. R=lrn@chromium.org BUG=v8:1436 TEST=mjsunit/regress/regress-1436.js Committed: http://code.google.com/p/v8/source/detail?r=8227

Patch Set 1 #

Total comments: 3

Patch Set 2 : Just fix the issue. :-) #

Total comments: 4

Patch Set 3 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -21 lines) Patch
M src/array.js View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/parser.h View 1 2 chunks +3 lines, -10 lines 0 comments Download
M src/parser.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/preparse-data.h View 1 2 chunks +8 lines, -2 lines 0 comments Download
M src/preparse-data-format.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/preparser.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/v8natives.js View 1 1 chunk +4 lines, -4 lines 0 comments Download
A test/mjsunit/regress/regress-1436.js View 1 2 1 chunk +79 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Mads Ager (chromium)
9 years, 6 months ago (2011-06-08 17:46:59 UTC) #1
Lasse Reichstein
http://codereview.chromium.org/7044054/diff/1/src/array.js File src/array.js (right): http://codereview.chromium.org/7044054/diff/1/src/array.js#newcode1007 src/array.js:1007: if (%_CallFunction(receiver, current, i, this, f)) { Does this ...
9 years, 6 months ago (2011-06-08 18:41:42 UTC) #2
Lasse Reichstein
9 years, 6 months ago (2011-06-08 18:43:28 UTC) #3
Mads Ager (chromium)
D'oh! I seem to remember having done this before. Thanks Lasse. :-) New patch uploaded ...
9 years, 6 months ago (2011-06-09 07:13:34 UTC) #4
Lasse Reichstein
LGTM http://codereview.chromium.org/7044054/diff/4001/test/mjsunit/regress/regress-1436.js File test/mjsunit/regress/regress-1436.js (right): http://codereview.chromium.org/7044054/diff/4001/test/mjsunit/regress/regress-1436.js#newcode40 test/mjsunit/regress/regress-1436.js:40: [2, 3].reduce(strict); Group by function called, like below ...
9 years, 6 months ago (2011-06-09 08:57:02 UTC) #5
Mads Ager (chromium)
9 years, 6 months ago (2011-06-09 09:05:03 UTC) #6
http://codereview.chromium.org/7044054/diff/4001/test/mjsunit/regress/regress...
File test/mjsunit/regress/regress-1436.js (right):

http://codereview.chromium.org/7044054/diff/4001/test/mjsunit/regress/regress...
test/mjsunit/regress/regress-1436.js:40: [2, 3].reduce(strict);
On 2011/06/09 08:57:02, Lasse Reichstein wrote:
> Group by function called, like below (i.e., both reduce calls before the
> reduceRight calls).

Done.

http://codereview.chromium.org/7044054/diff/4001/test/mjsunit/regress/regress...
test/mjsunit/regress/regress-1436.js:54: [2, 3].map(strict);
On 2011/06/09 08:57:02, Lasse Reichstein wrote:
> How about putting them in alphabetic order.
> Matbe also call with explicit thisArg values, both undefined and null (the
> strict mode function would need to be different for the null call).

Done.

Powered by Google App Engine
This is Rietveld 408576698