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

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed)

Created:
7 years, 9 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 9 months ago
Reviewers:
floitsch, srdjan, Ivan Posva
CC:
reviews_dartlang.org, srdjan
Visibility:
Public.

Description

Change getRange to sublist. Make getRange deprecated. This changes the exception behavior of getRange. It used to accept a length of zero, no matter what start value. Now the start value must be a valid list index. Committed: https://code.google.com/p/dart/source/detail?r=20064

Patch Set 1 #

Total comments: 8

Patch Set 2 : Addressed review comments. #

Patch Set 3 : Addressed review comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1073 lines, -398 lines) Patch
M editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart View 1 1 chunk +3 lines, -3 lines 0 comments Download
M pkg/analyzer_experimental/lib/src/generated/java_core.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M pkg/intl/lib/src/date_format_helpers.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/intl/test/date_time_format_test_core.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/scheduled_test/lib/src/descriptor/directory.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/array.dart View 1 2 chunks +15 lines, -6 lines 1 comment Download
M runtime/lib/byte_array.dart View 1 32 chunks +166 lines, -32 lines 0 comments Download
M runtime/lib/errors_patch.dart View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/growable_array.dart View 1 1 chunk +7 lines, -3 lines 0 comments Download
M runtime/lib/invocation_mirror_patch.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/lib/simd128.dart View 4 chunks +27 lines, -3 lines 1 comment Download
M runtime/lib/typeddata.dart View 1 2 chunks +8 lines, -2 lines 0 comments Download
M runtime/tests/vm/dart/byte_array_optimized_test.dart View 21 chunks +51 lines, -51 lines 0 comments Download
M runtime/tests/vm/dart/byte_array_test.dart View 1 24 chunks +89 lines, -56 lines 0 comments Download
M samples/swarm/swarm_ui_lib/observable/observable.dart View 1 1 chunk +4 lines, -0 lines 0 comments Download
M samples/swarm/swarm_ui_lib/touch/TouchHandler.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_collection_dev/arrays.dart View 1 chunk +9 lines, -0 lines 0 comments Download
M sdk/lib/_collection_dev/list.dart View 1 1 chunk +8 lines, -4 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart2js.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_array.dart View 1 1 chunk +18 lines, -11 lines 2 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/optimize.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/tracer.dart View 2 chunks +3 lines, -6 lines 0 comments Download
M sdk/lib/_internal/dartdoc/lib/src/client/dropdown.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/dartdoc/lib/src/dartdoc/utils.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/dartdoc/lib/src/markdown/inline_parser.dart View 1 chunk +1 line, -2 lines 0 comments Download
M sdk/lib/_internal/dartdoc/lib/universe_serializer.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/async/event_loop.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/async/timer.dart View 1 chunk +1 line, -1 line 0 comments Download
sdk/lib/core/list.dart View 1 1 chunk +12 lines, -6 lines 0 comments Download
M sdk/lib/crypto/hash_utils.dart View 1 chunk +1 line, -2 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 35 chunks +206 lines, -36 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 35 chunks +206 lines, -36 lines 0 comments Download
M sdk/lib/html/html_common/filtered_element_list.dart View 1 2 chunks +4 lines, -2 lines 0 comments Download
M sdk/lib/html/html_common/lists.dart View 1 chunk +5 lines, -6 lines 0 comments Download
M sdk/lib/io/buffer_list.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/http_parser.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/mime_multipart_parser.dart View 1 chunk +5 lines, -5 lines 0 comments Download
M sdk/lib/io/options.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/secure_socket.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/io/websocket_impl.dart View 4 chunks +5 lines, -4 lines 0 comments Download
M sdk/lib/svg/dart2js/svg_dart2js.dart View 1 6 chunks +36 lines, -6 lines 0 comments Download
M sdk/lib/svg/dartium/svg_dartium.dart View 1 6 chunks +36 lines, -6 lines 0 comments Download
M sdk/lib/utf/utf_stream.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/web_sql/dart2js/web_sql_dart2js.dart View 1 1 chunk +6 lines, -1 line 0 comments Download
M sdk/lib/web_sql/dartium/web_sql_dartium.dart View 1 1 chunk +6 lines, -1 line 0 comments Download
M tests/co19/co19-dart2dart.status View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/corelib/list_get_range_test.dart View 1 chunk +47 lines, -36 lines 0 comments Download
M tests/corelib/string_codeunits_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/html/element_test.dart View 3 chunks +6 lines, -6 lines 0 comments Download
M tests/html/node_test.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M tests/standalone/io/http_parser_test.dart View 4 chunks +8 lines, -12 lines 0 comments Download
M tests/standalone/io/mime_multipart_parser_test.dart View 1 chunk +3 lines, -5 lines 0 comments Download
M tests/standalone/io/web_socket_protocol_processor_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/standalone/io/zlib_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tools/dom/src/WrappedList.dart View 1 1 chunk +3 lines, -1 line 0 comments Download
M tools/dom/templates/html/impl/impl_Element.darttemplate View 1 2 chunks +11 lines, -3 lines 0 comments Download
M tools/dom/templates/html/impl/impl_Node.darttemplate View 1 1 chunk +6 lines, -1 line 0 comments Download
tools/dom/templates/immutable_list_mixin.darttemplate View 1 1 chunk +6 lines, -1 line 0 comments Download
M tools/testing/dart/http_server.dart View 1 1 chunk +3 lines, -5 lines 0 comments Download
M utils/pub/pub.dart View 1 chunk +1 line, -2 lines 0 comments Download
M utils/tests/pub/test_pub.dart View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Lasse Reichstein Nielsen
There might be a bug in pub yet, but the rest seems solid.
7 years, 9 months ago (2013-03-14 14:02:28 UTC) #1
floitsch
LGTM. https://codereview.chromium.org/12817003/diff/1/runtime/lib/array.dart File runtime/lib/array.dart (right): https://codereview.chromium.org/12817003/diff/1/runtime/lib/array.dart#newcode82 runtime/lib/array.dart:82: Arrays.indicesCheck(this, start, end); I would make this an ...
7 years, 9 months ago (2013-03-14 15:46:06 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/12817003/diff/1/runtime/lib/array.dart File runtime/lib/array.dart (right): https://codereview.chromium.org/12817003/diff/1/runtime/lib/array.dart#newcode82 runtime/lib/array.dart:82: Arrays.indicesCheck(this, start, end); It would not be a method ...
7 years, 9 months ago (2013-03-15 09:13:09 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #3 manually as r20064 (presubmit successful).
7 years, 9 months ago (2013-03-15 09:16:18 UTC) #4
Lasse Reichstein Nielsen
CCing Srdjan.
7 years, 9 months ago (2013-03-15 12:30:49 UTC) #5
Ivan Posva
DBC -ip https://codereview.chromium.org/12817003/diff/10001/runtime/lib/simd128.dart File runtime/lib/simd128.dart (right): https://codereview.chromium.org/12817003/diff/10001/runtime/lib/simd128.dart#newcode586 runtime/lib/simd128.dart:586: Why are you changing white space here?
7 years, 9 months ago (2013-03-18 03:17:39 UTC) #6
srdjan
DBC https://codereview.chromium.org/12817003/diff/10001/runtime/lib/array.dart File runtime/lib/array.dart (right): https://codereview.chromium.org/12817003/diff/10001/runtime/lib/array.dart#newcode87 runtime/lib/array.dart:87: Arrays.indicesCheck(this, start, end); It seems that this version ...
7 years, 9 months ago (2013-03-18 16:24:41 UTC) #7
floitsch
7 years, 9 months ago (2013-03-18 17:02:14 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/12817003/diff/10001/sdk/lib/_internal/compile...
File sdk/lib/_internal/compiler/implementation/lib/js_array.dart (right):

https://codereview.chromium.org/12817003/diff/10001/sdk/lib/_internal/compile...
sdk/lib/_internal/compiler/implementation/lib/js_array.dart:151: if (start is
!int) throw new ArgumentError(start);
On 2013/03/18 16:24:41, srdjan wrote:
> Isn't this different behavior than in the VM libraries?
If you want to have the same behavior on the VM and dart2js we have to check
types everywhere, as otherwise the code would need look the same on the two
platforms.

> Didn't we agree not to do explicit checks?
The result is used in a JS. We must check it. If you prefer we can move it
several lines down, but all 'start' checks are done here, so it makes sense to
do the type check here too.

Powered by Google App Engine
This is Rietveld 408576698