Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
index 9644ba2e92e2dc5d54413abbe35cd57160b9e11d..7f94ba02745562858abe19f8dc0bbe0148ba3074 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
@@ -811,6 +811,11 @@ class JavaScriptBackend extends Backend { |
enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, elements); |
} |
} |
+ if (cls == compiler.closureClass) { |
+ enqueue(enqueuer, |
+ compiler.findHelper('closureFromTearOff'), |
+ elements); |
+ } |
ClassElement result = null; |
if (cls == compiler.stringClass || cls == jsStringClass) { |
addInterceptors(jsStringClass, enqueuer, elements); |
@@ -991,6 +996,7 @@ class JavaScriptBackend extends Backend { |
} |
void registerIsCheck(DartType type, Enqueuer world, TreeElements elements) { |
+ enqueueInResolution(getThrowRuntimeError(), elements); |
type = type.unalias(compiler); |
enqueueClass(world, compiler.boolClass, elements); |
bool inCheckedMode = compiler.enableTypeAssertions; |
@@ -1048,6 +1054,7 @@ class JavaScriptBackend extends Backend { |
} |
void registerAsCheck(DartType type, Enqueuer world, TreeElements elements) { |
+ enqueueInResolution(getThrowRuntimeError(), elements); |
type = type.unalias(compiler); |
if (!world.isResolutionQueue) { |
// All helpers are added to resolution queue in enqueueHelpers. These |
@@ -1736,6 +1743,8 @@ class JavaScriptBackend extends Backend { |
* system. |
*/ |
bool isAccessibleByReflection(Element element) { |
+ // TODO(ahe): This isn't sufficient: simply importing dart:mirrors |
+ // causes hasInsufficientMirrorsUsed to become true. |
if (hasInsufficientMirrorsUsed) return true; |
return isNeededForReflection(element); |
} |