| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 tearOffInfo.add(callSelectorString); | 136 tearOffInfo.add(callSelectorString); |
| 137 } | 137 } |
| 138 | 138 |
| 139 expressions | 139 expressions |
| 140 ..addAll(tearOffInfo) | 140 ..addAll(tearOffInfo) |
| 141 ..add((tearOffName == null || member.isGetter || member.isSetter) | 141 ..add((tearOffName == null || member.isGetter || member.isSetter) |
| 142 ? js("null") | 142 ? js("null") |
| 143 : js.quoteName(tearOffName)) | 143 : js.quoteName(tearOffName)) |
| 144 ..add(js.number(requiredParameterCount)) | 144 ..add(js.number(requiredParameterCount)) |
| 145 ..add(js.number(optionalParameterCount)) | 145 ..add(js.number(optionalParameterCount)) |
| 146 ..add(memberTypeExpression == null ? js("null") : memberTypeExpression) | 146 ..add(memberTypeExpression == null ? js("null") : memberTypeExpression); |
| 147 ..addAll(task.metadataCollector.reifyDefaultArguments(member)); | |
| 148 | 147 |
| 149 if (canBeReflected || canBeApplied) { | 148 if (canBeReflected || canBeApplied) { |
| 149 expressions.addAll(task.metadataCollector.reifyDefaultArguments(member)); |
| 150 |
| 150 // TODO(redemption): Support entities. | 151 // TODO(redemption): Support entities. |
| 151 MethodElement method = member; | 152 MethodElement method = member; |
| 152 method.functionSignature.forEachParameter((Element parameter) { | 153 method.functionSignature.forEachParameter((Element parameter) { |
| 153 expressions.add(task.metadataCollector.reifyName(parameter.name)); | 154 expressions.add(task.metadataCollector.reifyName(parameter.name)); |
| 154 if (backend.mirrorsData.mustRetainMetadata) { | 155 if (backend.mirrorsData.mustRetainMetadata) { |
| 155 Iterable<jsAst.Expression> metadataIndices = | 156 Iterable<jsAst.Expression> metadataIndices = |
| 156 parameter.metadata.map((MetadataAnnotation annotation) { | 157 parameter.metadata.map((MetadataAnnotation annotation) { |
| 157 ConstantValue constant = | 158 ConstantValue constant = |
| 158 backend.constants.getConstantValueForMetadata(annotation); | 159 backend.constants.getConstantValueForMetadata(annotation); |
| 159 codegenWorldBuilder.addCompileTimeConstantForEmission(constant); | 160 codegenWorldBuilder.addCompileTimeConstantForEmission(constant); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 185 jsAst.ArrayInitializer arrayInit = | 186 jsAst.ArrayInitializer arrayInit = |
| 186 new jsAst.ArrayInitializer(expressions.toList()); | 187 new jsAst.ArrayInitializer(expressions.toList()); |
| 187 compiler.dumpInfoTask | 188 compiler.dumpInfoTask |
| 188 .registerElementAst(member, builder.addProperty(name, arrayInit)); | 189 .registerElementAst(member, builder.addProperty(name, arrayInit)); |
| 189 } | 190 } |
| 190 | 191 |
| 191 void addMemberField(Field field, ClassBuilder builder) { | 192 void addMemberField(Field field, ClassBuilder builder) { |
| 192 // For now, do nothing. | 193 // For now, do nothing. |
| 193 } | 194 } |
| 194 } | 195 } |
| OLD | NEW |