Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
index 754e5aa0bad1b1481b6868da298300901da924c3..b569cfce5153ffda7739dbce7cdb09c987a87049 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
@@ -477,9 +477,11 @@ class JavaScriptBackend extends Backend { |
} |
bool isInterceptedMethod(Element element) { |
- return element.isInstanceMember() |
- && !element.isGenerativeConstructorBody() |
- && interceptedElements[element.name] != null; |
+ if (!element.isInstanceMember()) return false; |
+ if (element.isGenerativeConstructorBody()) { |
+ return Elements.isNativeOrExtendsNative(element.getEnclosingClass()); |
+ } |
+ return interceptedElements[element.name] != null; |
} |
bool fieldHasInterceptedGetter(Element element) { |
@@ -952,8 +954,29 @@ class JavaScriptBackend extends Backend { |
if (element.isTypedef()) { |
typedefTypeLiterals.add(element); |
} |
+ registerEscapingConstructorsOfClass(element, enqueuer); |
+ } |
+ |
+ |
+ void registerEscapingConstructorsOfClass(ClassElement classElement, |
+ Enqueuer enqueuer) { |
+ // Web component classes have constructors that are escaped to the host |
+ // environment. |
+ classElement.ensureResolved(compiler); |
kasperl
2013/10/04 11:08:43
You may want to consider if you can avoid the stat
sra1
2013/10/04 20:21:28
I'll TODO it for now.
It would be nice if there w
|
+ if (Elements.isNativeOrExtendsNative(classElement)) { |
kasperl
2013/10/04 11:08:43
I guess we are sure that we're only calling Elemen
sra1
2013/10/04 20:21:28
Added assertion in isNativeOrExtendsNative.
|
+ classElement.forEachMember( |
+ (ClassElement enclosingClass, Element member) { |
kasperl
2013/10/04 11:08:43
Maybe this would be more readable if you introduce
sra1
2013/10/04 20:21:28
Done.
|
+ if (member.isGenerativeConstructor()) { |
+ enqueuer.registerStaticUse(member); |
+ } |
+ }, |
+ includeBackendMembers: false, |
+ includeSuperAndInjectedMembers: false); |
+ } |
} |
+ |
+ |
void registerStackTraceInCatch(TreeElements elements) { |
enqueueInResolution(getTraceFromException(), elements); |
} |