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

Unified Diff: lib/runtime/dart/_js_helper.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
« no previous file with comments | « lib/runtime/dart/_internal.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index 977407d40fd397404206155f4b86bb10d1123d37..be3814a2864546a7b5e54b0ec1bdb4594889f56f 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -41,18 +41,24 @@ var _js_helper;
throw new core.UnsupportedError("Cannot modify unmodifiable Map");
}
set(key, val) {
+ dart.as(key, K);
+ dart.as(val, V);
return this[_throwUnmodifiable]();
}
putIfAbsent(key, ifAbsent) {
+ dart.as(key, K);
+ dart.as(ifAbsent, dart.functionType(V, []));
return dart.as(this[_throwUnmodifiable](), V);
}
remove(key) {
+ dart.as(key, K);
return dart.as(this[_throwUnmodifiable](), V);
}
clear() {
return this[_throwUnmodifiable]();
}
addAll(other) {
+ dart.as(other, core.Map$(K, V));
return this[_throwUnmodifiable]();
}
}
@@ -73,6 +79,7 @@ var _js_helper;
super._();
}
containsValue(needle) {
+ dart.as(needle, V);
return this.values[core.$any](value => dart.equals(value, needle));
}
containsKey(key) {
@@ -91,6 +98,7 @@ var _js_helper;
return jsPropertyAccess(this[_jsObject], dart.as(key, core.String));
}
forEach(f) {
+ dart.as(f, dart.functionType(dart.void, [K, V]));
let keys = this[_keys];
for (let i = 0; core.int['<'](i, dart.dload(keys, 'length')); i = dart.notNull(i) + 1) {
let key = dart.dindex(keys, i);
@@ -164,6 +172,7 @@ var _js_helper;
return this.$map;
}
containsValue(needle) {
+ dart.as(needle, V);
return this[_getMap]().containsValue(needle);
}
containsKey(key) {
@@ -173,6 +182,7 @@ var _js_helper;
return this[_getMap]().get(key);
}
forEach(f) {
+ dart.as(f, dart.functionType(dart.void, [K, V]));
this[_getMap]().forEach(f);
}
get keys() {
« no previous file with comments | « lib/runtime/dart/_internal.js ('k') | lib/runtime/dart/async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698