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

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

Issue 1117793002: add checks needed for covariant generics, and List<E> (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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 fb349ba24347530099bf6ad4f1f96d0c7972340e..1305ed5298f85750de58fbba2154aa5863d7b66f 100644
--- a/lib/runtime/dart/collection.js
+++ b/lib/runtime/dart/collection.js
@@ -39,8 +39,11 @@ var collection;
class HashMap extends core.Object {
HashMap(opts) {
let equals = opts && 'equals' in opts ? opts.equals : null;
+ dart.as(equals, dart.functionType(core.bool, [K, K]));
vsm 2015/04/30 14:00:51 We shouldn't need runtime checks on constructor pa
Jennifer Messerly 2015/05/01 20:43:04 fixed
let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
+ dart.as(hashCode, dart.functionType(core.int, [K]));
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -77,7 +80,9 @@ var collection;
}
fromIterable(iterable, opts) {
let key = opts && 'key' in opts ? opts.key : null;
+ dart.as(key, dart.functionType(K, [dart.dynamic]));
let value = opts && 'value' in opts ? opts.value : null;
+ dart.as(value, dart.functionType(V, [dart.dynamic]));
let map = new (HashMap$(K, V))();
Maps._fillMapWithMappedIterable(map, iterable, key, value);
return map;
@@ -300,7 +305,9 @@ var collection;
return result;
}
[core.$firstWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
for (let element of this) {
if (test(element))
return element;
@@ -310,7 +317,9 @@ var collection;
throw _internal.IterableElementError.noElement();
}
[core.$lastWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
let result = null;
let foundMatching = false;
for (let element of this) {
@@ -400,8 +409,11 @@ var collection;
class HashSet extends core.Object {
HashSet(opts) {
let equals = opts && 'equals' in opts ? opts.equals : null;
+ dart.as(equals, dart.functionType(core.bool, [E, E]));
let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
+ dart.as(hashCode, dart.functionType(core.int, [E]));
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -587,7 +599,9 @@ var collection;
return result;
}
[core.$firstWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
for (let element of this) {
if (test(element))
return element;
@@ -597,7 +611,9 @@ var collection;
throw _internal.IterableElementError.noElement();
}
[core.$lastWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
let result = null;
let foundMatching = false;
for (let element of this) {
@@ -785,7 +801,9 @@ var collection;
return result;
}
[core.$firstWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
for (let element of this) {
if (test(element))
return element;
@@ -795,7 +813,9 @@ var collection;
throw _internal.IterableElementError.noElement();
}
[core.$lastWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
let result = null;
let foundMatching = false;
for (let element of this) {
@@ -1021,8 +1041,11 @@ var collection;
class LinkedHashMap extends core.Object {
LinkedHashMap(opts) {
let equals = opts && 'equals' in opts ? opts.equals : null;
+ dart.as(equals, dart.functionType(core.bool, [K, K]));
let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
+ dart.as(hashCode, dart.functionType(core.int, [K]));
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -1059,7 +1082,9 @@ var collection;
}
fromIterable(iterable, opts) {
let key = opts && 'key' in opts ? opts.key : null;
+ dart.as(key, dart.functionType(K, [dart.dynamic]));
let value = opts && 'value' in opts ? opts.value : null;
+ dart.as(value, dart.functionType(V, [dart.dynamic]));
let map = new (LinkedHashMap$(K, V))();
Maps._fillMapWithMappedIterable(map, iterable, key, value);
return map;
@@ -1100,8 +1125,11 @@ var collection;
class LinkedHashSet extends core.Object {
LinkedHashSet(opts) {
let equals = opts && 'equals' in opts ? opts.equals : null;
+ dart.as(equals, dart.functionType(core.bool, [E, E]));
let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
+ dart.as(hashCode, dart.functionType(core.int, [E]));
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
@@ -1171,15 +1199,18 @@ var collection;
this[_next] = this[_previous] = this;
}
addFirst(entry) {
+ dart.as(entry, E);
this[_insertAfter](this, entry);
}
add(entry) {
+ dart.as(entry, E);
this[_insertAfter](this[_previous], entry);
}
addAll(entries) {
entries[core.$forEach]((entry => this[_insertAfter](this[_previous], dart.as(entry, E))).bind(this));
}
remove(entry) {
+ dart.as(entry, E);
if (!dart.equals(entry[_list], this))
return false;
this[_unlink](entry);
@@ -1238,6 +1269,7 @@ var collection;
return this[_length] == 0;
}
[_insertAfter](entry, newEntry) {
+ dart.as(newEntry, E);
if (newEntry.list != null) {
throw new core.StateError('LinkedListEntry is already in a LinkedList');
}
@@ -1323,9 +1355,11 @@ var collection;
return dart.as(this[_previous], E);
}
insertAfter(entry) {
+ dart.as(entry, E);
this[_list][_insertAfter](this, entry);
}
insertBefore(entry) {
+ dart.as(entry, E);
this[_list][_insertAfter](this[_previous], entry);
}
}
@@ -1407,7 +1441,9 @@ var collection;
return false;
}
[core.$firstWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
let length = this[core.$length];
for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull(i) + 1) {
let element = this[core.$get](i);
@@ -1422,7 +1458,9 @@ var collection;
throw _internal.IterableElementError.noElement();
}
[core.$lastWhere](test, opts) {
+ dart.as(test, dart.functionType(core.bool, [E]));
let orElse = opts && 'orElse' in opts ? opts.orElse : null;
+ dart.as(orElse, dart.functionType(E, []));
let length = this[core.$length];
for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
let element = this[core.$get](i);
@@ -1533,6 +1571,7 @@ var collection;
return result;
}
[core.$add](element) {
+ dart.as(element, E);
this[core.$set]((() => {
let o = this, x = o[core.$length];
o[core.$length] = dart.notNull(x) + 1;
@@ -1596,6 +1635,7 @@ var collection;
[core.$sort](compare) {
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;
@@ -1648,12 +1688,14 @@ var collection;
[core.$fillRange](start, end, fill) {
if (fill === void 0)
fill = null;
+ dart.as(fill, E);
core.RangeError.checkValidRange(start, end, this[core.$length]);
for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) + 1) {
this[core.$set](i, fill);
}
}
[core.$setRange](start, end, iterable, skipCount) {
+ dart.as(iterable, core.Iterable$(E));
if (skipCount === void 0)
skipCount = 0;
core.RangeError.checkValidRange(start, end, this[core.$length]);
@@ -1745,6 +1787,7 @@ var collection;
return -1;
}
[core.$insert](index, element) {
+ dart.as(element, E);
core.RangeError.checkValueInInterval(index, 0, this[core.$length], "index");
if (index == this[core.$length]) {
this[core.$add](element);
@@ -1820,6 +1863,7 @@ var collection;
}
}
containsValue(value) {
+ dart.as(value, V);
for (let key of this.keys) {
if (dart.equals(this.get(key), value))
return true;
@@ -1827,6 +1871,8 @@ var collection;
return false;
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
if (this.keys[core.$contains](key)) {
return this.get(key);
}
@@ -1863,6 +1909,8 @@ var collection;
let _UnmodifiableMapMixin$ = dart.generic(function(K, V) {
class _UnmodifiableMapMixin extends core.Object {
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
throw new core.UnsupportedError("Cannot modify unmodifiable map");
}
addAll(other) {
@@ -1875,6 +1923,8 @@ var collection;
throw new core.UnsupportedError("Cannot modify unmodifiable map");
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
throw new core.UnsupportedError("Cannot modify unmodifiable map");
}
}
@@ -1953,6 +2003,8 @@ var collection;
return this[_map].get(key);
}
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
this[_map].set(key, value);
}
addAll(other) {
@@ -1962,6 +2014,8 @@ var collection;
this[_map].clear();
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
return this[_map].putIfAbsent(key, ifAbsent);
}
containsKey(key) {
@@ -2123,6 +2177,7 @@ var collection;
let DoubleLinkedQueueEntry$ = dart.generic(function(E) {
class DoubleLinkedQueueEntry extends core.Object {
DoubleLinkedQueueEntry(e) {
+ dart.as(e, E);
this[_element] = e;
this[_previous] = null;
this[_next] = null;
@@ -2134,9 +2189,11 @@ var collection;
next[_previous] = this;
}
append(e) {
+ dart.as(e, E);
new (DoubleLinkedQueueEntry$(E))(e)[_link](this, this[_next]);
}
prepend(e) {
+ dart.as(e, E);
new (DoubleLinkedQueueEntry$(E))(e)[_link](this[_previous], this);
}
remove() {
@@ -2159,6 +2216,7 @@ var collection;
return this[_element];
}
set element(e) {
+ dart.as(e, E);
this[_element] = e;
}
}
@@ -2178,6 +2236,7 @@ var collection;
return null;
}
set element(e) {
+ dart.as(e, E);
dart.assert(false);
}
get element() {
@@ -2209,14 +2268,17 @@ var collection;
return this[_elementCount];
}
addLast(value) {
+ dart.as(value, E);
this[_sentinel].prepend(value);
this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
}
addFirst(value) {
+ dart.as(value, E);
this[_sentinel].append(value);
this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
}
add(value) {
+ dart.as(value, E);
this[_sentinel].prepend(value);
this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
}
@@ -2436,6 +2498,7 @@ var collection;
return list;
}
add(element) {
+ dart.as(element, E);
this[_add](element);
}
addAll(elements) {
@@ -2511,9 +2574,11 @@ var collection;
return IterableBase.iterableToFullString(this, "{", "}");
}
addLast(element) {
+ dart.as(element, E);
this[_add](element);
}
addFirst(element) {
+ dart.as(element, E);
this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][core.$length]) - 1;
this[_table][core.$set](this[_head], element);
if (this[_head] == this[_tail])
@@ -2557,6 +2622,7 @@ var collection;
}
}
[_add](element) {
+ dart.as(element, E);
this[_table][core.$set](this[_tail], element);
this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][core.$length]) - 1;
if (this[_head] == this[_tail])
@@ -2665,6 +2731,7 @@ var collection;
let _SplayTreeNode$ = dart.generic(function(K) {
class _SplayTreeNode extends core.Object {
_SplayTreeNode(key) {
+ dart.as(key, K);
this.key = key;
this.left = null;
this.right = null;
@@ -2676,6 +2743,8 @@ var collection;
let _SplayTreeMapNode$ = dart.generic(function(K, V) {
class _SplayTreeMapNode extends _SplayTreeNode$(K) {
_SplayTreeMapNode(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
this.value = value;
super._SplayTreeNode(key);
}
@@ -2705,6 +2774,7 @@ var collection;
this[_splayCount] = 0;
}
[_splay](key) {
+ dart.as(key, K);
if (this[_root] == null)
return -1;
let left = this[_dummy];
@@ -2778,6 +2848,7 @@ var collection;
return dart.as(current, _SplayTreeNode$(K));
}
[_remove](key) {
+ dart.as(key, K);
if (this[_root] == null)
return null;
let comp = this[_splay](key);
@@ -2850,8 +2921,10 @@ var collection;
SplayTreeMap(compare, isValidKey) {
if (compare === void 0)
compare = null;
+ dart.as(compare, dart.functionType(core.int, [K, K]));
if (isValidKey === void 0)
isValidKey = null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
this[_comparator] = dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, core.Comparator$(K));
this[_validKey] = dart.as(isValidKey != null ? isValidKey : v => dart.is(v, K), _Predicate);
super._SplayTree();
@@ -2859,8 +2932,10 @@ var collection;
from(other, compare, isValidKey) {
if (compare === void 0)
compare = null;
+ dart.as(compare, dart.functionType(core.int, [K, K]));
if (isValidKey === void 0)
isValidKey = null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
let result = new (SplayTreeMap$(K, V))();
other.forEach((k, v) => {
result.set(k, dart.as(v, V));
@@ -2869,23 +2944,33 @@ var collection;
}
fromIterable(iterable, opts) {
let key = opts && 'key' in opts ? opts.key : null;
+ dart.as(key, dart.functionType(K, [dart.dynamic]));
let value = opts && 'value' in opts ? opts.value : null;
+ dart.as(value, dart.functionType(V, [dart.dynamic]));
let compare = opts && 'compare' in opts ? opts.compare : null;
+ dart.as(compare, dart.functionType(core.int, [K, K]));
let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
let map = new (SplayTreeMap$(K, V))(compare, isValidKey);
Maps._fillMapWithMappedIterable(map, iterable, key, value);
return map;
}
fromIterables(keys, values, compare, isValidKey) {
+ dart.as(keys, core.Iterable$(K));
+ dart.as(values, core.Iterable$(V));
if (compare === void 0)
compare = null;
+ dart.as(compare, dart.functionType(core.int, [K, K]));
if (isValidKey === void 0)
isValidKey = null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
let map = new (SplayTreeMap$(K, V))(compare, isValidKey);
Maps._fillMapWithIterables(map, keys, values);
return map;
}
[_compare](key1, key2) {
+ dart.as(key1, K);
+ dart.as(key2, K);
return this[_comparator](key1, key2);
}
_internal() {
@@ -2916,6 +3001,8 @@ var collection;
return null;
}
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
if (key == null)
throw new core.ArgumentError(key);
let comp = this[_splay](key);
@@ -2927,6 +3014,8 @@ var collection;
this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp);
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
if (key == null)
throw new core.ArgumentError(key);
let comp = this[_splay](key);
@@ -2949,6 +3038,8 @@ var collection;
}
addAll(other) {
other.forEach(((key, value) => {
+ dart.as(key, K);
+ dart.as(value, V);
this.set(key, value);
}).bind(this));
}
@@ -3013,6 +3104,7 @@ var collection;
return dart.as(this[_last].key, K);
}
lastKeyBefore(key) {
+ dart.as(key, K);
if (key == null)
throw new core.ArgumentError(key);
if (this[_root] == null)
@@ -3029,6 +3121,7 @@ var collection;
return node.key;
}
firstKeyAfter(key) {
+ dart.as(key, K);
if (key == null)
throw new core.ArgumentError(key);
if (this[_root] == null)
@@ -3222,8 +3315,10 @@ var collection;
SplayTreeSet(compare, isValidKey) {
if (compare === void 0)
compare = null;
+ dart.as(compare, dart.functionType(core.int, [E, E]));
if (isValidKey === void 0)
isValidKey = null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
this[_comparator] = dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, core.Comparator);
this[_validKey] = dart.as(isValidKey != null ? isValidKey : v => dart.is(v, E), _Predicate);
super._SplayTree();
@@ -3231,8 +3326,10 @@ var collection;
from(elements, compare, isValidKey) {
if (compare === void 0)
compare = null;
+ dart.as(compare, dart.functionType(core.int, [E, E]));
if (isValidKey === void 0)
isValidKey = null;
+ dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
let result = new (SplayTreeSet$(E))(compare, isValidKey);
for (let element of dart.as(elements, core.Iterable$(E))) {
result.add(element);
@@ -3240,6 +3337,8 @@ var collection;
return result;
}
[_compare](e1, e2) {
+ dart.as(e1, E);
+ dart.as(e2, E);
return dart.dcall(this[_comparator], e1, e2);
}
get [core.$iterator]() {
@@ -3275,6 +3374,7 @@ var collection;
return dart.notNull(dart.dcall(this[_validKey], object)) && this[_splay](dart.as(object, E)) == 0;
}
add(element) {
+ dart.as(element, E);
let compare = this[_splay](element);
if (compare == 0)
return false;
@@ -3443,6 +3543,8 @@ var collection;
}
addAll(other) {
other.forEach(((key, value) => {
+ dart.as(key, K);
+ dart.as(value, V);
this.set(key, value);
}).bind(this));
}
@@ -3466,6 +3568,8 @@ var collection;
return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(index) + 1], V);
}
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
if (_HashMap._isStringKey(key)) {
let strings = this[_strings];
if (strings == null)
@@ -3481,6 +3585,8 @@ var collection;
}
}
[_set](key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
let rest = this[_rest];
if (rest == null)
this[_rest] = rest = _HashMap._newHashTable();
@@ -3502,6 +3608,8 @@ var collection;
}
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
if (this.containsKey(key))
return this.get(key);
let value = ifAbsent();
@@ -3589,6 +3697,8 @@ var collection;
return this[_keys] = result;
}
[_addHashTableEntry](table, key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
if (!dart.notNull(_HashMap._hasTableEntry(table, key))) {
this[_length] = dart.notNull(this[_length]) + 1;
this[_keys] = null;
@@ -3694,6 +3804,8 @@ var collection;
return super[_get](key);
}
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
super[_set](key, value);
}
containsKey(key) {
@@ -3850,6 +3962,8 @@ var collection;
}
addAll(other) {
other.forEach(((key, value) => {
+ dart.as(key, K);
+ dart.as(value, V);
this.set(key, value);
}).bind(this));
}
@@ -3882,6 +3996,8 @@ var collection;
return dart.as(cell[_value], V);
}
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
if (_LinkedHashMap._isStringKey(key)) {
let strings = this[_strings];
if (strings == null)
@@ -3897,6 +4013,8 @@ var collection;
}
}
[_set](key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
let rest = this[_rest];
if (rest == null)
this[_rest] = rest = _LinkedHashMap._newHashTable();
@@ -3917,6 +4035,8 @@ var collection;
}
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
if (this.containsKey(key))
return this.get(key);
let value = ifAbsent();
@@ -3963,6 +4083,8 @@ var collection;
}
}
[_addHashTableEntry](table, key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHashMapCell);
if (cell == null) {
_LinkedHashMap._setTableEntry(table, key, this[_newLinkedCell](key, value));
@@ -3984,6 +4106,8 @@ var collection;
this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863;
}
[_newLinkedCell](key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
let cell = new LinkedHashMapCell(key, value);
if (this[_first] == null) {
this[_first] = this[_last] = cell;
@@ -4097,6 +4221,8 @@ var collection;
return super[_get](key);
}
set(key, value) {
+ dart.as(key, K);
+ dart.as(value, V);
super[_set](key, value);
}
containsKey(key) {
@@ -4262,6 +4388,7 @@ var collection;
return dart.as(bucket[core.$get](index), E);
}
add(element) {
+ dart.as(element, E);
if (_HashSet._isStringElement(element)) {
let strings = this[_strings];
if (strings == null)
@@ -4277,6 +4404,7 @@ var collection;
}
}
[_add](element) {
+ dart.as(element, E);
let rest = this[_rest];
if (rest == null)
this[_rest] = rest = _HashSet._newHashTable();
@@ -4370,6 +4498,7 @@ var collection;
return this[_elements] = result;
}
[_addHashTableEntry](table, element) {
+ dart.as(element, E);
if (_HashSet._hasTableEntry(table, element))
return false;
_HashSet._setTableEntry(table, element, 0);
@@ -4482,6 +4611,7 @@ var collection;
return this[_hasher](dart.as(element, E)) & 0x3ffffff;
}
add(object) {
+ dart.as(object, E);
return super[_add](object);
}
[core.$contains](object) {
@@ -4626,6 +4756,7 @@ var collection;
return dart.as(this[_last][_element], E);
}
add(element) {
+ dart.as(element, E);
if (_LinkedHashSet._isStringElement(element)) {
let strings = this[_strings];
if (strings == null)
@@ -4641,6 +4772,7 @@ var collection;
}
}
[_add](element) {
+ dart.as(element, E);
let rest = this[_rest];
if (rest == null)
this[_rest] = rest = _LinkedHashSet._newHashTable();
@@ -4708,6 +4840,7 @@ var collection;
}
}
[_addHashTableEntry](table, element) {
+ dart.as(element, E);
let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), LinkedHashSetCell);
if (cell != null)
return false;
@@ -4728,6 +4861,7 @@ var collection;
this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863;
}
[_newLinkedCell](element) {
+ dart.as(element, E);
let cell = new LinkedHashSetCell(element);
if (this[_first] == null) {
this[_first] = this[_last] = cell;
@@ -4853,6 +4987,7 @@ var collection;
return this[_hasher](dart.as(element, E)) & 0x3ffffff;
}
add(element) {
+ dart.as(element, E);
return super[_add](element);
}
[core.$contains](object) {

Powered by Google App Engine
This is Rietveld 408576698