| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 joinFor(enqueuer).instantiatedClasses.add(classElement); | 74 joinFor(enqueuer).instantiatedClasses.add(classElement); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void registerTypeLiteral(DartType type, Registry registry) { | 77 void registerTypeLiteral(DartType type) { |
| 78 assert(registry.isForResolution); | |
| 79 // In codegen we see the TypeConstants instead. | |
| 80 if (!registry.isForResolution) return; | |
| 81 | |
| 82 if (type.isInterfaceType) { | 78 if (type.isInterfaceType) { |
| 83 // TODO(sra): If we had a flow query from the type literal expression to | 79 // TODO(sra): If we had a flow query from the type literal expression to |
| 84 // the Type argument of the metadata lookup, we could tell if this type | 80 // the Type argument of the metadata lookup, we could tell if this type |
| 85 // literal is really a demand for the metadata. | 81 // literal is really a demand for the metadata. |
| 86 resolutionJoin.selectedClasses.add(type.element); | 82 resolutionJoin.selectedClasses.add(type.element); |
| 87 } else if (type.isTypeVariable) { | 83 } else if (type.isTypeVariable) { |
| 88 // This is a type parameter of a parameterized class. | 84 // This is a type parameter of a parameterized class. |
| 89 // TODO(sra): Is there a way to determine which types are bound to the | 85 // TODO(sra): Is there a way to determine which types are bound to the |
| 90 // parameter? | 86 // parameter? |
| 91 resolutionJoin.allClassesSelected = true; | 87 resolutionJoin.allClassesSelected = true; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 result.add(member); | 193 result.add(member); |
| 198 } | 194 } |
| 199 } | 195 } |
| 200 } | 196 } |
| 201 classElement.forEachMember(selectGenerativeConstructors, | 197 classElement.forEachMember(selectGenerativeConstructors, |
| 202 includeBackendMembers: false, | 198 includeBackendMembers: false, |
| 203 includeSuperAndInjectedMembers: false); | 199 includeSuperAndInjectedMembers: false); |
| 204 return result; | 200 return result; |
| 205 } | 201 } |
| 206 } | 202 } |
| OLD | NEW |