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

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
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..aa9a7acfc5c0bc6971c52fc27d1431d44c86807a 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -41,12 +41,17 @@ 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() {
@@ -73,6 +78,7 @@ var _js_helper;
super._();
}
containsValue(needle) {
+ dart.as(needle, V);
return this.values[core.$any](value => dart.equals(value, needle));
}
containsKey(key) {
@@ -113,6 +119,7 @@ var _js_helper;
let ConstantProtoMap$ = dart.generic(function(K, V) {
class ConstantProtoMap extends ConstantStringMap$(K, V) {
_(length, jsObject, keys, protoValue) {
+ dart.as(protoValue, V);
this[_protoValue] = protoValue;
super._(dart.as(length, core.int), jsObject, dart.as(keys, core.List$(K)));
}
@@ -164,6 +171,7 @@ var _js_helper;
return this.$map;
}
containsValue(needle) {
+ dart.as(needle, V);
return this[_getMap]().containsValue(needle);
}
containsKey(key) {

Powered by Google App Engine
This is Rietveld 408576698