| 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 library dart2js.js_emitter.full_emitter.container_builder; | 5 library dart2js.js_emitter.full_emitter.container_builder; |
| 6 | 6 |
| 7 import '../../constants/values.dart'; | 7 import '../../constants/values.dart'; |
| 8 import '../../elements/elements.dart' | 8 import '../../elements/elements.dart' |
| 9 show Element, MetadataAnnotation, MethodElement; | 9 show Element, MetadataAnnotation, MethodElement; |
| 10 import '../../elements/entities.dart'; | 10 import '../../elements/entities.dart'; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (canBeReflected || canBeApplied) { | 149 if (canBeReflected || canBeApplied) { |
| 150 // TODO(johnniwinther): Support entities. | 150 // TODO(johnniwinther): Support entities. |
| 151 MethodElement method = member; | 151 MethodElement method = member; |
| 152 method.functionSignature.forEachParameter((Element parameter) { | 152 method.functionSignature.forEachParameter((Element parameter) { |
| 153 expressions.add(task.metadataCollector.reifyName(parameter.name)); | 153 expressions.add(task.metadataCollector.reifyName(parameter.name)); |
| 154 if (backend.mirrorsData.mustRetainMetadata) { | 154 if (backend.mirrorsData.mustRetainMetadata) { |
| 155 Iterable<jsAst.Expression> metadataIndices = | 155 Iterable<jsAst.Expression> metadataIndices = |
| 156 parameter.metadata.map((MetadataAnnotation annotation) { | 156 parameter.metadata.map((MetadataAnnotation annotation) { |
| 157 ConstantValue constant = | 157 ConstantValue constant = |
| 158 backend.constants.getConstantValueForMetadata(annotation); | 158 backend.constants.getConstantValueForMetadata(annotation); |
| 159 backend.constants.addCompileTimeConstantForEmission(constant); | 159 codegenWorldBuilder.addCompileTimeConstantForEmission(constant); |
| 160 return task.metadataCollector.reifyMetadata(annotation); | 160 return task.metadataCollector.reifyMetadata(annotation); |
| 161 }); | 161 }); |
| 162 expressions.add(new jsAst.ArrayInitializer(metadataIndices.toList())); | 162 expressions.add(new jsAst.ArrayInitializer(metadataIndices.toList())); |
| 163 } | 163 } |
| 164 }); | 164 }); |
| 165 } | 165 } |
| 166 Name memberName = new Name(member.name, member.library); | 166 Name memberName = new Name(member.name, member.library); |
| 167 if (canBeReflected) { | 167 if (canBeReflected) { |
| 168 jsAst.LiteralString reflectionName; | 168 jsAst.LiteralString reflectionName; |
| 169 if (member.isConstructor) { | 169 if (member.isConstructor) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 185 jsAst.ArrayInitializer arrayInit = | 185 jsAst.ArrayInitializer arrayInit = |
| 186 new jsAst.ArrayInitializer(expressions.toList()); | 186 new jsAst.ArrayInitializer(expressions.toList()); |
| 187 compiler.dumpInfoTask | 187 compiler.dumpInfoTask |
| 188 .registerElementAst(member, builder.addProperty(name, arrayInit)); | 188 .registerElementAst(member, builder.addProperty(name, arrayInit)); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void addMemberField(Field field, ClassBuilder builder) { | 191 void addMemberField(Field field, ClassBuilder builder) { |
| 192 // For now, do nothing. | 192 // For now, do nothing. |
| 193 } | 193 } |
| 194 } | 194 } |
| OLD | NEW |