Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 25675002: Generative constructor factories for native objects (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/enqueue.dart
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart
index e489fb187294d571ad7d413a97c685b2ec130e64..f674e5b0b7601bc5c9704d9f94d169fafad97bda 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -136,8 +136,27 @@ abstract class Enqueuer {
}
void registerTypeLiteral(Element element, TreeElements elements) {
+ assert(isResolutionQueue);
registerInstantiatedClass(compiler.typeClass, elements);
compiler.backend.registerTypeLiteral(element, this, elements);
+ registerEscapingConstructorsOfClass(element);
+ }
+
+ void registerEscapingConstructorsOfClass(ClassElement classElement) {
+ // Web component classes have constructors that are escaped to the host
+ // environment.
+ classElement.forEachMember(
+ (ClassElement enclosingClass, Element member) {
+ if (member.isGenerativeConstructor()) {
+ // isNativeOrExtendsNative is valid only after resolution.
+ if (isResolutionQueue
+ || Elements.isNativeOrExtendsNative(classElement)) {
+ registerStaticUse(member);
ahe 2013/10/03 07:44:49 This means that all constructors of type literals
sra1 2013/10/03 17:00:23 I think that isNativeOrExtendsNative can be made t
+ }
+ }
+ },
+ includeBackendMembers: false,
+ includeSuperAndInjectedMembers: false);
}
bool checkNoEnqueuedInvokedInstanceMethods() {

Powered by Google App Engine
This is Rietveld 408576698