Index: pkg/dev_compiler/lib/js/es6/dart_sdk.js |
diff --git a/pkg/dev_compiler/lib/js/es6/dart_sdk.js b/pkg/dev_compiler/lib/js/es6/dart_sdk.js |
index b6171c16c923cc31fe9a5e9edc6582b509be1ca5..d71474d601c95219b0866dcdccce017a411e98b6 100644 |
--- a/pkg/dev_compiler/lib/js/es6/dart_sdk.js |
+++ b/pkg/dev_compiler/lib/js/es6/dart_sdk.js |
@@ -1207,10 +1207,20 @@ dart.tagComputed = function(value, compute) { |
dart.tagLazy = function(value, compute) { |
dart.defineLazyProperty(value, dart._runtimeType, {get: compute}); |
}; |
+dart._warn = function(arg) { |
+ console.warn(arg); |
+}; |
const _jsTypeCallback = Symbol('_jsTypeCallback'); |
const _rawJSType = Symbol('_rawJSType'); |
+const _dartName = Symbol('_dartName'); |
dart._isInstanceOfLazyJSType = function(o, t) { |
if (t[_jsTypeCallback] != null) { |
+ if (t[_rawJSType] == null) { |
+ let expected = t[_dartName]; |
+ let actual = dart.typeName(dart.getReifiedType(o)); |
+ dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`); |
+ return true; |
+ } |
return dart.is(o, t[_rawJSType]); |
} |
if (o == null) return false; |
@@ -1218,6 +1228,12 @@ dart._isInstanceOfLazyJSType = function(o, t) { |
}; |
dart._asInstanceOfLazyJSType = function(o, t) { |
if (t[_jsTypeCallback] != null) { |
+ if (t[_rawJSType] == null) { |
+ let expected = t[_dartName]; |
+ let actual = dart.typeName(dart.getReifiedType(o)); |
+ dart._warn(dart.str`Cannot find native JavaScript type (${expected}) ` + dart.str`to type check ${actual}`); |
+ return o; |
+ } |
return dart.as(o, t[_rawJSType]); |
} |
if (o == null) return null; |
@@ -1252,6 +1268,9 @@ dart._initialize2 = function() { |
dart.LazyJSType.prototype.as = function as_T(object) { |
return dart._asInstanceOfLazyJSType(object, this); |
}; |
+ dart.LazyJSType.prototype._check = function check_T(object) { |
+ return dart._asInstanceOfLazyJSType(object, this); |
+ }; |
}; |
dart._functionType = function(definite, returnType, args, extra) { |
if (args === void 0 && extra === void 0) { |
@@ -2214,7 +2233,6 @@ dart.Dynamic = class Dynamic extends dart.TypeRep { |
return 'dynamic'; |
} |
}; |
-const _dartName = Symbol('_dartName'); |
dart.LazyJSType = class LazyJSType extends core.Object { |
new(jsTypeCallback, dartName) { |
this[_jsTypeCallback] = jsTypeCallback; |