Index: pkg/compiler/lib/src/js_emitter/native_emitter.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart |
index df8778df24427efc1b36ab67e4bc5e4a9ab2d5ef..fe9cbae2cc09eeb7eff9c34bf34d6e2ff6e00683 100644 |
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart |
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart |
@@ -134,8 +134,9 @@ class NativeEmitter { |
} else if (extensionPoints.containsKey(cls)) { |
needed = true; |
} |
- if (cls.isNative && |
- native.nativeTagsForcedNonLeaf(classElement)) { |
+ if (classElement.isJsInterop) { |
+ needed = true; // TODO(jacobr): we don't need all interop classes. |
+ } else if (cls.isNative && native.nativeTagsForcedNonLeaf(classElement)) { |
needed = true; |
nonLeafClasses.add(cls); |
} |
@@ -154,6 +155,7 @@ class NativeEmitter { |
for (Class cls in classes) { |
if (!cls.isNative) continue; |
+ if (cls.element.isJsInterop) continue; |
List<String> nativeTags = native.nativeTagsOfClass(cls.element); |
if (nonLeafClasses.contains(cls) || |
@@ -294,7 +296,7 @@ class NativeEmitter { |
// The target JS function may check arguments.length so we need to |
// make sure not to pass any unspecified optional arguments to it. |
// For example, for the following Dart method: |
- // foo([x, y, z]); |
+ // foo({x, y, z}); |
// The call: |
// foo(y: 1) |
// must be turned into a JS call to: |
@@ -319,9 +321,16 @@ class NativeEmitter { |
} else { |
// Native methods that are not intercepted must be static. |
assert(invariant(member, member.isStatic)); |
- receiver = js('this'); |
arguments = argumentsBuffer.sublist(0, |
indexOfLastOptionalArgumentInParameters + 1); |
+ if (member.isJsInterop) { |
+ // fixedBackendPath is allowed to have the form foo.bar.baz for |
+ // interop. |
+ receiver = js.uncachedExpressionTemplate( |
Siggi Cherem (dart-lang)
2015/10/06 22:38:02
might be worth explaining why does this need to be
Jacob
2015/10/13 01:19:23
Done.
|
+ backend.namer.fixedBackendPath(member)).instantiate([]); |
+ } else { |
+ receiver = js('this'); |
+ } |
} |
statements.add( |
js.statement('return #.#(#)', [receiver, target, arguments])); |