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

Unified Diff: lib/runtime/dart/collection.js

Issue 1093353004: fix list initializers (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: baselines Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/convert.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/collection.js
diff --git a/lib/runtime/dart/collection.js b/lib/runtime/dart/collection.js
index f6cb64deccddd09f1365765bfef365ed9b4b40b6..54d68b2c2644015ab131ab2f85520b3b1e6a11f9 100644
--- a/lib/runtime/dart/collection.js
+++ b/lib/runtime/dart/collection.js
@@ -136,7 +136,7 @@ var collection;
this.removeAll(toRemove);
}
removeWhere(test) {
- let toRemove = new core.List.from([]);
+ let toRemove = [];
for (let element of this) {
if (test(element))
toRemove[core.$add](element);
@@ -144,7 +144,7 @@ var collection;
this.removeAll(toRemove);
}
retainWhere(test) {
- let toRemove = new core.List.from([]);
+ let toRemove = [];
for (let element of this) {
if (!dart.notNull(test(element)))
toRemove[core.$add](element);
@@ -857,7 +857,7 @@ var collection;
}
return `${leftDelimiter}...${rightDelimiter}`;
}
- let parts = new core.List.from([]);
+ let parts = [];
IterableBase[_toStringVisiting][core.$add](iterable);
try {
IterableBase[_iterablePartsToStrings](iterable, parts);
@@ -980,7 +980,7 @@ var collection;
IterableBase[dart.implements] = () => [core.Iterable$(E)];
dart.defineLazyProperties(IterableBase, {
get _toStringVisiting() {
- return new core.List.from([]);
+ return [];
}
});
return IterableBase;
@@ -1577,7 +1577,7 @@ var collection;
ListMixin[_filter](this, test, true);
}
static [_filter](source, test, retainMatching) {
- let retained = new core.List.from([]);
+ let retained = [];
let length = source[core.$length];
for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull(i) + 1) {
let element = source[core.$get](i);
@@ -3077,7 +3077,7 @@ var collection;
let _SplayTreeIterator$ = dart.generic(function(T) {
class _SplayTreeIterator extends core.Object {
_SplayTreeIterator(tree) {
- this[_workList] = new core.List$(_SplayTreeNode).from([]);
+ this[_workList] = dart.setType([], core.List$(_SplayTreeNode));
this[_tree] = tree;
this[_modificationCount] = tree[_modificationCount];
this[_splayCount] = tree[_splayCount];
@@ -3085,7 +3085,7 @@ var collection;
this[_findLeftMostDescendent](tree[_root]);
}
startAt(tree, startKey) {
- this[_workList] = new core.List$(_SplayTreeNode).from([]);
+ this[_workList] = dart.setType([], core.List$(_SplayTreeNode));
this[_tree] = tree;
this[_modificationCount] = tree[_modificationCount];
this[_splayCount] = null;
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/convert.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698