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

Issue 1318943005: Update range errors to agree on the numbers. (Closed)

Created:
5 years, 3 months ago by Lasse Reichstein Nielsen
Modified:
5 years, 2 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org, floitsch
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Update range errors to agree on the numbers. Also ensure that typed-data errors are consistent with other lists. Fixes issue #24295 BUG= http://dartbug.com/24295 R=floitsch@google.com, iposva@google.com, sra@google.com Committed: https://github.com/dart-lang/sdk/commit/d755dd65b94d7fa21233070e90f84b9edc73fb2c

Patch Set 1 #

Total comments: 6

Patch Set 2 : Made dart2js version more monomorphic #

Patch Set 3 : Improve dart2js typed data. #

Patch Set 4 : Tweak JS output. #

Total comments: 12

Patch Set 5 : Update other uses of throwRangeError, remove kRangeRange. #

Patch Set 6 : More tests #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -178 lines) Patch
M runtime/lib/array.cc View 3 chunks +12 lines, -12 lines 5 comments Download
M runtime/lib/growable_array.cc View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/lib/growable_array.dart View 1 chunk +2 lines, -3 lines 0 comments Download
M runtime/lib/simd128.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/string.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/lib/typed_data.dart View 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/exceptions.h View 1 2 3 4 1 chunk +0 lines, -1 line 1 comment Download
M runtime/vm/exceptions.cc View 1 2 3 4 2 chunks +1 line, -5 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_array.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_helper.dart View 1 2 2 chunks +24 lines, -1 line 0 comments Download
M sdk/lib/_internal/js_runtime/lib/native_typed_data.dart View 1 2 3 22 chunks +70 lines, -141 lines 0 comments Download
M sdk/lib/core/errors.dart View 1 2 3 1 chunk +5 lines, -4 lines 0 comments Download
M tests/corelib/list_test.dart View 1 2 3 4 5 2 chunks +84 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (3 generated)
Lasse Reichstein Nielsen
5 years, 3 months ago (2015-09-08 10:07:37 UTC) #2
floitsch
LGTM. https://codereview.chromium.org/1318943005/diff/1/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart File sdk/lib/_internal/js_runtime/lib/native_typed_data.dart (right): https://codereview.chromium.org/1318943005/diff/1/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart#newcode1921 sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1921: int _checkValidRange(int start, int end, List list) { ...
5 years, 3 months ago (2015-09-08 10:54:19 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/1318943005/diff/1/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart File sdk/lib/_internal/js_runtime/lib/native_typed_data.dart (right): https://codereview.chromium.org/1318943005/diff/1/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart#newcode1921 sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1921: int _checkValidRange(int start, int end, List list) { So ...
5 years, 3 months ago (2015-09-08 11:38:04 UTC) #5
Lasse Reichstein Nielsen
5 years, 3 months ago (2015-09-08 11:54:21 UTC) #6
floitsch
https://codereview.chromium.org/1318943005/diff/1/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart File sdk/lib/_internal/js_runtime/lib/native_typed_data.dart (right): https://codereview.chromium.org/1318943005/diff/1/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart#newcode1921 sdk/lib/_internal/js_runtime/lib/native_typed_data.dart:1921: int _checkValidRange(int start, int end, List list) { On ...
5 years, 3 months ago (2015-09-08 13:53:25 UTC) #7
sra1
For dart2js you currently must make all the logic work in diagnoseIndexError. If you don't ...
5 years, 3 months ago (2015-09-08 17:49:20 UTC) #8
Lasse Reichstein Nielsen
PTAL. Output of swarm is now almost identical except for the start/end names on range ...
5 years, 3 months ago (2015-09-09 10:31:40 UTC) #9
sra1
LGTM! Thanks! https://codereview.chromium.org/1318943005/diff/60001/sdk/lib/core/errors.dart File sdk/lib/core/errors.dart (right): https://codereview.chromium.org/1318943005/diff/60001/sdk/lib/core/errors.dart#newcode392 sdk/lib/core/errors.dart:392: String get _errorName => "RangeError"; Was this ...
5 years, 3 months ago (2015-09-09 17:16:05 UTC) #10
Ivan Posva
This still needs some work. For example you need to ensure that all calls to ...
5 years, 3 months ago (2015-09-10 05:15:00 UTC) #11
Lasse Reichstein Nielsen
Good point Ivan. I went through the other uses of throwRangeError and fixed where necessary ...
5 years, 3 months ago (2015-09-10 10:08:54 UTC) #12
Ivan Posva
LGTM with comments -Ivan https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc File runtime/lib/array.cc (right): https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc#newcode59 runtime/lib/array.cc:59: Smi::Handle(Smi::New(istart)), start https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc#newcode68 runtime/lib/array.cc:68: Smi::Handle(Smi::New(icount)), ...
5 years, 3 months ago (2015-09-11 09:12:51 UTC) #13
Lasse Reichstein Nielsen
Committed patchset #6 (id:100001) manually as d755dd65b94d7fa21233070e90f84b9edc73fb2c (presubmit successful).
5 years, 3 months ago (2015-09-11 11:05:43 UTC) #14
srdjan
https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc File runtime/lib/array.cc (right): https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc#newcode70 runtime/lib/array.cc:70: src.Length() - istart); Shouldn't this be "src.Length()" only.
5 years, 2 months ago (2015-09-25 20:32:17 UTC) #16
Lasse Reichstein Nielsen
https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc File runtime/lib/array.cc (right): https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc#newcode70 runtime/lib/array.cc:70: src.Length() - istart); Probably. Maybe it would be simpler ...
5 years, 2 months ago (2015-09-25 23:28:22 UTC) #17
Lasse Reichstein Nielsen
5 years, 2 months ago (2015-09-25 23:29:15 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc
File runtime/lib/array.cc (right):

https://codereview.chromium.org/1318943005/diff/100001/runtime/lib/array.cc#n...
runtime/lib/array.cc:70: src.Length() - istart);
... but that would mean changing "count" above to "end".
With the name "count", then this is the limit.

Powered by Google App Engine
This is Rietveld 408576698