| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if ((isNative && selectedClasses.contains(classElement)) || | 156 if ((isNative && selectedClasses.contains(classElement)) || |
| 157 (isExtension && | 157 (isExtension && |
| 158 (allClassesSelected || selectedClasses.contains(classElement)))) { | 158 (allClassesSelected || selectedClasses.contains(classElement)))) { |
| 159 newActiveClasses.add(classElement); | 159 newActiveClasses.add(classElement); |
| 160 escapingConstructors(classElement).forEach(enqueuer.registerStaticUse); | 160 escapingConstructors(classElement).forEach(enqueuer.registerStaticUse); |
| 161 // Force the generaton of the type constant that is the key to an entry | 161 // Force the generaton of the type constant that is the key to an entry |
| 162 // in the generated table. | 162 // in the generated table. |
| 163 Constant constant = makeTypeConstant(classElement); | 163 Constant constant = makeTypeConstant(classElement); |
| 164 backend.registerCompileTimeConstant( | 164 backend.registerCompileTimeConstant( |
| 165 constant, compiler.globalDependencies); | 165 constant, compiler.globalDependencies); |
| 166 compiler.constantHandler.addCompileTimeConstantForEmission(constant); | 166 backend.constants.addCompileTimeConstantForEmission(constant); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 activeClasses.addAll(newActiveClasses); | 169 activeClasses.addAll(newActiveClasses); |
| 170 instantiatedClasses.removeAll(newActiveClasses); | 170 instantiatedClasses.removeAll(newActiveClasses); |
| 171 } | 171 } |
| 172 | 172 |
| 173 TypeConstant makeTypeConstant(ClassElement element) { | 173 TypeConstant makeTypeConstant(ClassElement element) { |
| 174 DartType elementType = element.rawType; | 174 DartType elementType = element.rawType; |
| 175 DartType constantType = backend.typeImplementation.rawType; | 175 DartType constantType = backend.typeImplementation.rawType; |
| 176 return new TypeConstant(elementType, constantType); | 176 return new TypeConstant(elementType, constantType); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 192 result.add(member); | 192 result.add(member); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 classElement.forEachMember(selectGenerativeConstructors, | 196 classElement.forEachMember(selectGenerativeConstructors, |
| 197 includeBackendMembers: false, | 197 includeBackendMembers: false, |
| 198 includeSuperAndInjectedMembers: false); | 198 includeSuperAndInjectedMembers: false); |
| 199 return result; | 199 return result; |
| 200 } | 200 } |
| 201 } | 201 } |
| OLD | NEW |