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

Issue 1226143009: Fix limit calculation in String.prototype.split (Closed)

Created:
5 years, 5 months ago by Eric Caruso
Modified:
4 years, 9 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix limit calculation in String.prototype.split We are supposed to calculate the limit by using 2^53-1 if it is undefined, and ToLength otherwise. Instead, we were using 32-bit unsigned integer values, which don't make sense and were breaking a test. R=littledan@chromium.org LOG=N BUG=v8:4245

Patch Set 1 #

Patch Set 2 : Fixed test expectations #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -4 lines) Patch
M src/string.js View 2 chunks +3 lines, -1 line 2 comments Download
M test/test262-es6/test262-es6.status View 1 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
Eric Caruso
5 years, 5 months ago (2015-07-09 22:08:05 UTC) #1
arv (Not doing code reviews)
You mentioned that we are breaking a test? Which one? Do you need to update ...
5 years, 5 months ago (2015-07-10 16:24:52 UTC) #2
Eric Caruso
On 2015/07/10 16:24:52, arv (Not doing code reviews) wrote: > You mentioned that we are ...
5 years, 5 months ago (2015-07-10 16:57:29 UTC) #3
Dan Ehrenberg
This is great. Just one little fix needed. https://codereview.chromium.org/1226143009/diff/20001/src/string.js File src/string.js (right): https://codereview.chromium.org/1226143009/diff/20001/src/string.js#newcode612 src/string.js:612: limit ...
5 years, 5 months ago (2015-07-13 23:19:13 UTC) #4
adamk
https://codereview.chromium.org/1226143009/diff/20001/src/string.js File src/string.js (right): https://codereview.chromium.org/1226143009/diff/20001/src/string.js#newcode612 src/string.js:612: limit = IS_UNDEFINED(limit) ? GlobalNumber.MAX_SAFE_INTEGER On 2015/07/13 23:19:13, Dan ...
5 years, 5 months ago (2015-07-14 00:16:49 UTC) #6
Dan Ehrenberg
lgtm Oh, right.
5 years, 5 months ago (2015-07-15 00:02:32 UTC) #7
adamk
lgtm
5 years, 5 months ago (2015-07-15 00:04:32 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1226143009/20001
5 years, 5 months ago (2015-07-15 17:29:03 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_avx2_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel/builds/2374) (exceeded global retry quota)
5 years, 5 months ago (2015-07-15 17:38:18 UTC) #12
Eric Caruso
On 2015/07/15 17:38:18, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 5 months ago (2015-07-15 17:51:56 UTC) #13
adamk
Yes, per spec, this test is now wrong. I wondered at first why this was ...
5 years, 5 months ago (2015-07-15 22:56:36 UTC) #15
adamk
The broader question I have for rossberg is something like: why did TC39 make ToLength ...
5 years, 5 months ago (2015-07-15 22:59:01 UTC) #16
rossberg
5 years, 5 months ago (2015-07-16 10:45:40 UTC) #17
On 2015/07/15 22:59:01, adamk wrote:
> The broader question I have for rossberg is something like: why did TC39 make
> ToLength have different behavior for negative values than ToUint32?

The wrap-around semantics of ToUint is completely crazy, and would be even
crazier when applied to random ranges like 0..2^53. Using -1 as a (non-)limit
used to work more by accident than by design. But admittedly, the crop semantics
of ToLength isn't great either. It would be best to throw, but that might have
broken too much code. Just guessing, I'm afraid I don't know the exact
motivation.

Powered by Google App Engine
This is Rietveld 408576698