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

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

Issue 1112403004: SDK fixes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Formatting fix 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
Index: lib/runtime/dart/collection.js
diff --git a/lib/runtime/dart/collection.js b/lib/runtime/dart/collection.js
index a54af9a2a5921508dd11435d66c65d38748b9e73..bf282be6ff34229486fce99d06e76664a818ca0d 100644
--- a/lib/runtime/dart/collection.js
+++ b/lib/runtime/dart/collection.js
@@ -1675,11 +1675,7 @@ var collection;
if (compare === void 0)
compare = null;
dart.as(compare, dart.functionType(core.int, [E, E]));
- if (compare == null) {
- let defaultCompare = dart.bind(core.Comparable, 'compare');
- compare = defaultCompare;
- }
- _internal.Sort.sort(this, compare);
+ _internal.Sort.sort(this, dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, __CastType20));
}
[core.$shuffle](random) {
if (random === void 0)
@@ -1892,6 +1888,7 @@ var collection;
return ListBase;
});
let ListBase = ListBase$();
+ let __CastType20 = dart.typedef('__CastType20', () => dart.functionType(core.int, [dart.dynamic, dart.dynamic]));
let MapMixin$ = dart.generic(function(K, V) {
class MapMixin extends core.Object {
forEach(action) {
@@ -1907,7 +1904,6 @@ var collection;
}
}
containsValue(value) {
- dart.as(value, V);
for (let key of this.keys) {
if (dart.equals(this.get(key), value))
return true;
@@ -2964,15 +2960,6 @@ var collection;
return _SplayTree;
});
let _SplayTree = _SplayTree$();
- let _TypeTest$ = dart.generic(function(T) {
- class _TypeTest extends core.Object {
- test(v) {
- return dart.is(v, T);
- }
- }
- return _TypeTest;
- });
- let _TypeTest = _TypeTest$();
let _comparator = Symbol('_comparator');
let _validKey = Symbol('_validKey');
let SplayTreeMap$ = dart.generic(function(K, V) {
@@ -3230,7 +3217,7 @@ var collection;
get current() {
if (this[_currentNode] == null)
return null;
- return this[_getValue](this[_currentNode]);
+ return this[_getValue](dart.as(this[_currentNode], _SplayTreeMapNode));
}
[_findLeftMostDescendent](node) {
while (node != null) {
@@ -3288,7 +3275,7 @@ var collection;
}
[core.$toSet]() {
let setOrMap = this[_tree];
- let set = new (SplayTreeSet$(K))(dart.as(setOrMap[_comparator], __CastType20), dart.as(setOrMap[_validKey], __CastType23));
+ let set = new (SplayTreeSet$(K))(dart.as(setOrMap[_comparator], __CastType23), dart.as(setOrMap[_validKey], __CastType26));
set[_count] = this[_tree][_count];
set[_root] = set[_copyNode](this[_tree][_root]);
return set;
@@ -3447,7 +3434,7 @@ var collection;
}
}
retainAll(elements) {
- let retainSet = new (SplayTreeSet$(E))(dart.as(this[_comparator], __CastType25), this[_validKey]);
+ let retainSet = new (SplayTreeSet$(E))(dart.as(this[_comparator], __CastType28), this[_validKey]);
let modificationCount = this[_modificationCount];
for (let object of elements) {
if (modificationCount != this[_modificationCount]) {
@@ -3471,7 +3458,6 @@ var collection;
return this[_root].key;
}
intersection(other) {
- dart.as(other, core.Set$(E));
let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.functionType(core.int, [E, E])), this[_validKey]);
for (let element of this) {
if (other[core.$contains](element))
@@ -3480,7 +3466,6 @@ var collection;
return result;
}
difference(other) {
- dart.as(other, core.Set$(E));
let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.functionType(core.int, [E, E])), this[_validKey]);
for (let element of this) {
if (!dart.notNull(other[core.$contains](element)))
@@ -3523,17 +3508,17 @@ var collection;
return SplayTreeSet;
});
let SplayTreeSet = SplayTreeSet$();
- let __CastType20$ = dart.generic(function(K) {
- let __CastType20 = dart.typedef('__CastType20', () => dart.functionType(core.int, [K, K]));
- return __CastType20;
+ let __CastType23$ = dart.generic(function(K) {
+ let __CastType23 = dart.typedef('__CastType23', () => dart.functionType(core.int, [K, K]));
+ return __CastType23;
});
- let __CastType20 = __CastType20$();
- let __CastType23 = dart.typedef('__CastType23', () => dart.functionType(core.bool, [dart.dynamic]));
- let __CastType25$ = dart.generic(function(E) {
- let __CastType25 = dart.typedef('__CastType25', () => dart.functionType(core.int, [E, E]));
- return __CastType25;
+ let __CastType23 = __CastType23$();
+ let __CastType26 = dart.typedef('__CastType26', () => dart.functionType(core.bool, [dart.dynamic]));
+ let __CastType28$ = dart.generic(function(E) {
+ let __CastType28 = dart.typedef('__CastType28', () => dart.functionType(core.int, [E, E]));
+ return __CastType28;
});
- let __CastType25 = __CastType25$();
+ let __CastType28 = __CastType28$();
let _strings = Symbol('_strings');
let _nums = Symbol('_nums');
let _rest = Symbol('_rest');

Powered by Google App Engine
This is Rietveld 408576698