Chromium Code Reviews| Index: pkg/compiler/lib/src/js_backend/backend.dart |
| diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
| index ce801a9b8414fb83ec11b204a952f63a9ed69dcb..c5c7eb0b6eb1e14ba287c8420e04d113992feb11 100644 |
| --- a/pkg/compiler/lib/src/js_backend/backend.dart |
| +++ b/pkg/compiler/lib/src/js_backend/backend.dart |
| @@ -289,6 +289,7 @@ class JavaScriptBackend extends Backend { |
| ClassElement jsBoolClass; |
| ClassElement jsPlainJavaScriptObjectClass; |
| ClassElement jsUnknownJavaScriptObjectClass; |
| + ClassElement jsJavaScriptFunctionClass; |
| ClassElement jsIndexableClass; |
| ClassElement jsMutableIndexableClass; |
| @@ -1039,6 +1040,7 @@ class JavaScriptBackend extends Backend { |
| enqueue(enqueuer, getNativeInterceptorMethod, registry); |
| enqueueClass(enqueuer, jsInterceptorClass, compiler.globalDependencies); |
| enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, registry); |
| + enqueueClass(enqueuer, jsJavaScriptFunctionClass, registry); |
| } else if (cls == mapLiteralClass) { |
| // For map literals, the dependency between the implementation class |
| // and [Map] is not visible, so we have to add it manually. |
| @@ -1119,6 +1121,8 @@ class JavaScriptBackend extends Backend { |
| addInterceptors(jsPlainJavaScriptObjectClass, enqueuer, registry); |
| } else if (cls == jsUnknownJavaScriptObjectClass) { |
| addInterceptors(jsUnknownJavaScriptObjectClass, enqueuer, registry); |
| + } else if (cls == jsJavaScriptFunctionClass) { |
| + addInterceptors(jsJavaScriptFunctionClass, enqueuer, registry); |
| } else if (Elements.isNativeOrExtendsNative(cls)) { |
| addInterceptorsForNativeClassMembers(cls, enqueuer); |
| } else if (cls == jsIndexingBehaviorInterface) { |
| @@ -1137,6 +1141,7 @@ class JavaScriptBackend extends Backend { |
| Registry registry = compiler.globalDependencies; |
| enqueue(enqueuer, getNativeInterceptorMethod, registry); |
| enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, registry); |
| + enqueueClass(enqueuer, jsJavaScriptFunctionClass, registry); |
| needToInitializeIsolateAffinityTag = true; |
| needToInitializeDispatchProperty = true; |
| } |
| @@ -1272,7 +1277,7 @@ class JavaScriptBackend extends Backend { |
| if (!type.treatAsRaw || type.containsTypeVariables) { |
| enqueueClass(world, compiler.listClass, registry); |
| } |
| - if (type.element != null && type.element.isNative) { |
| + if (type.element != null && (type.element.isNative || type.element.isJsInterop)) { |
|
alexandre.ardhuin
2015/09/03 20:14:11
nit: line length
|
| // We will neeed to add the "$is" and "$as" properties on the |
| // JavaScript object prototype, so we make sure |
| // [:defineProperty:] is compiled. |
| @@ -1468,7 +1473,7 @@ class JavaScriptBackend extends Backend { |
| ClassElement defaultSuperclass(ClassElement element) { |
| // Native classes inherit from Interceptor. |
| - return element.isNative ? jsInterceptorClass : compiler.objectClass; |
| + return (element.isNative || element.isJsInterop) ? jsInterceptorClass : compiler.objectClass; |
|
alexandre.ardhuin
2015/09/03 20:14:11
nit: line length
|
| } |
| /** |
| @@ -2099,6 +2104,7 @@ class JavaScriptBackend extends Backend { |
| jsExtendableArrayClass = findClass('JSExtendableArray'); |
| jsUnmodifiableArrayClass = findClass('JSUnmodifiableArray'); |
| jsPlainJavaScriptObjectClass = findClass('PlainJavaScriptObject'); |
| + jsJavaScriptFunctionClass = findClass('JavaScriptFunction'); |
| jsUnknownJavaScriptObjectClass = findClass('UnknownJavaScriptObject'); |
| jsIndexableClass = findClass('JSIndexable'); |
| jsMutableIndexableClass = findClass('JSMutableIndexable'); |
| @@ -3002,7 +3008,7 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| backend.find(backend.jsHelperLibrary, 'functionTypeTestMetaHelper'), |
| registry); |
| } |
| - if (type.element != null && type.element.isNative) { |
| + if (type.element != null && (type.element.isNative || type.element.isJsInterop)) { |
|
alexandre.ardhuin
2015/09/03 20:14:11
nit: line length
|
| // We will neeed to add the "$is" and "$as" properties on the |
| // JavaScript object prototype, so we make sure |
| // [:defineProperty:] is compiled. |