| Index: pkg/dev_compiler/lib/js/common/dart_sdk.js
|
| diff --git a/pkg/dev_compiler/lib/js/common/dart_sdk.js b/pkg/dev_compiler/lib/js/common/dart_sdk.js
|
| index 34eb1dc43cd34117619d7c35d4255047e8205b74..654e13fcf30f6d13ddf11c49e355305c17659b8a 100644
|
| --- a/pkg/dev_compiler/lib/js/common/dart_sdk.js
|
| +++ b/pkg/dev_compiler/lib/js/common/dart_sdk.js
|
| @@ -1123,6 +1123,14 @@
|
| dart.getType = function(obj) {
|
| return obj == null ? core.Object : obj.__proto__.constructor;
|
| };
|
| + dart.isJsInterop = function(obj) {
|
| + if (typeof obj === "function") {
|
| + return dart._getRuntimeType(obj) == null;
|
| + }
|
| + if (typeof obj !== "object") return false;
|
| + if (dart.getExtensionType(obj) != null) return false;
|
| + return !(obj instanceof core.Object);
|
| + };
|
| dart.getMethodType = function(type, name) {
|
| let sigObj = type[dart._methodSig];
|
| if (sigObj === void 0) return void 0;
|
| @@ -1922,6 +1930,17 @@
|
| let type = dart.getType(obj);
|
| if (dart.test(dart.hasField(type, f)) || dart.test(dart.hasGetter(type, f))) return obj[f];
|
| if (dart.test(dart.hasMethod(type, f))) return dart.bind(obj, f, void 0);
|
| + if (dart.test(dart.isJsInterop(obj))) return obj[f];
|
| + }
|
| + return dart.noSuchMethod(obj, new dart.InvocationImpl(field, [], {isGetter: true}));
|
| + };
|
| + dart.dloadMirror = function(obj, field) {
|
| + let f = dart._canonicalMember(obj, field);
|
| + dart._trackCall(obj);
|
| + if (f != null) {
|
| + let type = dart.getType(obj);
|
| + if (dart.test(dart.hasField(type, f)) || dart.test(dart.hasGetter(type, f))) return obj[f];
|
| + if (dart.test(dart.hasMethod(type, f))) return dart.bind(obj, f, void 0);
|
| }
|
| return dart.noSuchMethod(obj, new dart.InvocationImpl(field, [], {isGetter: true}));
|
| };
|
| @@ -1930,7 +1949,7 @@
|
| if (genericClass != null) return genericClass();
|
| return type;
|
| };
|
| - dart.dputLegacy = function(obj, field, value) {
|
| + dart.dputMirror = function(obj, field, value) {
|
| let f = dart._canonicalMember(obj, field);
|
| dart._trackCall(obj);
|
| if (f != null) {
|
| @@ -1960,6 +1979,9 @@
|
| if (fieldType != void 0) {
|
| return obj[f] = dart.check(value, fieldType);
|
| }
|
| + if (dart.test(dart.isJsInterop(obj))) {
|
| + return obj[f] = value;
|
| + }
|
| }
|
| }
|
| return dart.noSuchMethod(obj, new dart.InvocationImpl(field, [value], {isSetter: true}));
|
| @@ -13655,11 +13677,11 @@
|
| }
|
| });
|
| _js_mirrors._dload = function(obj, name) {
|
| - return _js_mirrors._dart.dload(obj, name);
|
| + return _js_mirrors._dart.dloadMirror(obj, name);
|
| };
|
| dart.lazyFn(_js_mirrors._dload, () => dynamicAndStringTodynamic());
|
| _js_mirrors._dput = function(obj, name, val) {
|
| - _js_mirrors._dart.dputLegacy(obj, name, val);
|
| + _js_mirrors._dart.dputMirror(obj, name, val);
|
| };
|
| dart.lazyFn(_js_mirrors._dput, () => dynamicAndStringAnddynamicTovoid());
|
| _js_mirrors._dcall = function(obj, args) {
|
|
|