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

Side by Side Diff: pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart

Issue 1318043005: Support user generated custom native JS classes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: ptal Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of js_backend; 5 part of js_backend;
6 6
7 /** 7 /**
8 * Support for Custom Elements. 8 * Support for Custom Elements.
9 * 9 *
10 * The support for custom elements the compiler builds a table that maps the 10 * The support for custom elements the compiler builds a table that maps the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 CustomElementsAnalysisJoin joinFor(Enqueuer enqueuer) => 66 CustomElementsAnalysisJoin joinFor(Enqueuer enqueuer) =>
67 enqueuer.isResolutionQueue ? resolutionJoin : codegenJoin; 67 enqueuer.isResolutionQueue ? resolutionJoin : codegenJoin;
68 68
69 void registerInstantiatedClass(ClassElement classElement, Enqueuer enqueuer) { 69 void registerInstantiatedClass(ClassElement classElement, Enqueuer enqueuer) {
70 classElement.ensureResolved(compiler.resolution); 70 classElement.ensureResolved(compiler.resolution);
71 if (!Elements.isNativeOrExtendsNative(classElement)) return; 71 if (!Elements.isNativeOrExtendsNative(classElement)) return;
72 if (classElement.isMixinApplication) return; 72 if (classElement.isMixinApplication) return;
73 if (classElement.isAbstract) return; 73 if (classElement.isAbstract) return;
74 // JsInterop classes are opaque interfaces without a concrete
75 // implementation.
76 if (classElement.isJsInterop) return;
74 joinFor(enqueuer).instantiatedClasses.add(classElement); 77 joinFor(enqueuer).instantiatedClasses.add(classElement);
75 } 78 }
76 79
77 void registerTypeLiteral(DartType type, Registry registry) { 80 void registerTypeLiteral(DartType type, Registry registry) {
78 assert(registry.isForResolution); 81 assert(registry.isForResolution);
79 // In codegen we see the TypeConstants instead. 82 // In codegen we see the TypeConstants instead.
80 if (!registry.isForResolution) return; 83 if (!registry.isForResolution) return;
81 84
82 if (type.isInterfaceType) { 85 if (type.isInterfaceType) {
83 // TODO(sra): If we had a flow query from the type literal expression to 86 // TODO(sra): If we had a flow query from the type literal expression to
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 result.add(member); 200 result.add(member);
198 } 201 }
199 } 202 }
200 } 203 }
201 classElement.forEachMember(selectGenerativeConstructors, 204 classElement.forEachMember(selectGenerativeConstructors,
202 includeBackendMembers: false, 205 includeBackendMembers: false,
203 includeSuperAndInjectedMembers: false); 206 includeSuperAndInjectedMembers: false);
204 return result; 207 return result;
205 } 208 }
206 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698