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

Issue 315173005: Add "last" setter to List. (Closed)

Created:
6 years, 6 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 6 months ago
Reviewers:
nweiz, Søren Gjesse
CC:
reviews_dartlang.org, ricow1, vm-dev_dartlang.org, Kevin Millikin (Google), floitsch
Visibility:
Public.

Description

Add "last" setter to List. This allows assigning directly as `list.last = value` instead of having to use the longer `list[list.length - 1] = value`. It's just an abbreviation, like `list.last` is for reading. If you use a List as a stack (which is a perfectly good use of it), modifying the last element like this is a natural operation. R=sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=37255

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -22 lines) Patch
M pkg/collection/lib/wrappers.dart View 2 chunks +5 lines, -1 line 1 comment Download
M pkg/collection/pubspec.yaml View 1 chunk +1 line, -1 line 0 comments Download
M pkg/collection/test/wrapper_test.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/third_party/html5lib/lib/dom.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/third_party/html5lib/lib/src/list_proxy.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/third_party/html5lib/pubspec.yaml View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/array.dart View 2 chunks +9 lines, -0 lines 0 comments Download
M runtime/lib/growable_array.dart View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/lib/typed_data.dart View 1 chunk +5 lines, -0 lines 0 comments Download
M samples-dev/swarm/swarm_ui_lib/observable/observable.dart View 1 chunk +7 lines, -0 lines 0 comments Download
M sdk/lib/_internal/lib/js_array.dart View 1 chunk +6 lines, -0 lines 0 comments Download
M sdk/lib/collection/list.dart View 8 chunks +16 lines, -11 lines 0 comments Download
M sdk/lib/core/list.dart View 1 chunk +10 lines, -0 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 2 chunks +5 lines, -2 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 2 chunks +5 lines, -2 lines 0 comments Download
M sdk/lib/internal/list.dart View 1 chunk +5 lines, -0 lines 0 comments Download
M tests/co19/co19-co19.status View 1 chunk +14 lines, -0 lines 0 comments Download
M tests/corelib/list_test.dart View 3 chunks +35 lines, -0 lines 0 comments Download
M third_party/pkg/js/lib/src/wrapping/js/array_to_list_adapter.dart View 1 chunk +5 lines, -2 lines 0 comments Download
M tools/dom/src/ImmutableListMixin.dart View 2 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein Nielsen
6 years, 6 months ago (2014-06-06 09:09:33 UTC) #1
Søren Gjesse
lgtm
6 years, 6 months ago (2014-06-10 07:14:49 UTC) #2
Lasse Reichstein Nielsen
Committed patchset #1 manually as r37255 (presubmit successful).
6 years, 6 months ago (2014-06-12 08:11:52 UTC) #3
nweiz
6 years, 6 months ago (2014-06-12 23:03:58 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/315173005/diff/1/pkg/collection/lib/wrappers....
File pkg/collection/lib/wrappers.dart (right):

https://codereview.chromium.org/315173005/diff/1/pkg/collection/lib/wrappers....
pkg/collection/lib/wrappers.dart:128: _listBase.last = value;
This will cause an analyzer warning on versions of the SDK that don't support
[List.last=] in the core libraries. It may be a good idea to increase the SDK
constraint in the pubspec to avoid that.

Powered by Google App Engine
This is Rietveld 408576698