| 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 dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 /// This class should morph into something that makes it easy to build | 7 /// This class should morph into something that makes it easy to build |
| 8 /// JavaScript representations of libraries, class-sides, and instance-sides. | 8 /// JavaScript representations of libraries, class-sides, and instance-sides. |
| 9 /// Initially, it is just a placeholder for code that is moved from | 9 /// Initially, it is just a placeholder for code that is moved from |
| 10 /// [CodeEmitterTask]. | 10 /// [CodeEmitterTask]. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 .reifyDefaultArguments(member).map(js.number)); | 134 .reifyDefaultArguments(member).map(js.number)); |
| 135 | 135 |
| 136 if (canBeReflected || canBeApplied) { | 136 if (canBeReflected || canBeApplied) { |
| 137 parameters.forEachParameter((Element parameter) { | 137 parameters.forEachParameter((Element parameter) { |
| 138 expressions.add( | 138 expressions.add( |
| 139 js.number(task.metadataCollector.reifyName(parameter.name))); | 139 js.number(task.metadataCollector.reifyName(parameter.name))); |
| 140 if (backend.mustRetainMetadata) { | 140 if (backend.mustRetainMetadata) { |
| 141 Iterable<int> metadataIndices = | 141 Iterable<int> metadataIndices = |
| 142 parameter.metadata.map((MetadataAnnotation annotation) { | 142 parameter.metadata.map((MetadataAnnotation annotation) { |
| 143 ConstantValue constant = | 143 ConstantValue constant = |
| 144 backend.constants.getConstantForMetadata(annotation).value; | 144 backend.constants.getConstantValueForMetadata(annotation); |
| 145 backend.constants.addCompileTimeConstantForEmission(constant); | 145 backend.constants.addCompileTimeConstantForEmission(constant); |
| 146 return task.metadataCollector.reifyMetadata(annotation); | 146 return task.metadataCollector.reifyMetadata(annotation); |
| 147 }); | 147 }); |
| 148 expressions.add(new jsAst.ArrayInitializer( | 148 expressions.add(new jsAst.ArrayInitializer( |
| 149 metadataIndices.map(js.number).toList())); | 149 metadataIndices.map(js.number).toList())); |
| 150 } | 150 } |
| 151 }); | 151 }); |
| 152 } | 152 } |
| 153 if (canBeReflected) { | 153 if (canBeReflected) { |
| 154 jsAst.LiteralString reflectionName; | 154 jsAst.LiteralString reflectionName; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 jsAst.ArrayInitializer arrayInit = | 172 jsAst.ArrayInitializer arrayInit = |
| 173 new jsAst.ArrayInitializer(expressions.toList()); | 173 new jsAst.ArrayInitializer(expressions.toList()); |
| 174 compiler.dumpInfoTask.registerElementAst(member, | 174 compiler.dumpInfoTask.registerElementAst(member, |
| 175 builder.addProperty(name, arrayInit)); | 175 builder.addProperty(name, arrayInit)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void addMemberField(Field field, ClassBuilder builder) { | 178 void addMemberField(Field field, ClassBuilder builder) { |
| 179 // For now, do nothing. | 179 // For now, do nothing. |
| 180 } | 180 } |
| 181 } | 181 } |
| OLD | NEW |