| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.constants.constructors; | 5 library dart2js.constants.constructors; |
| 6 | 6 |
| 7 import '../dart2jslib.dart'; | 7 import '../dart2jslib.dart'; |
| 8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../resolution/resolution.dart'; | 10 import '../resolution/resolution.dart'; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 arguments)); | 128 arguments)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 @override | 131 @override |
| 132 visitFactoryConstructorDeclaration( | 132 visitFactoryConstructorDeclaration( |
| 133 FunctionExpression node, | 133 FunctionExpression node, |
| 134 ConstructorElement constructor, | 134 ConstructorElement constructor, |
| 135 NodeList parameters, | 135 NodeList parameters, |
| 136 Node body, _) { | 136 Node body, _) { |
| 137 // TODO(johnniwinther): Handle constant constructors with errors. | 137 // TODO(johnniwinther): Handle constant constructors with errors. |
| 138 internalError(node, "Factory constructor cannot be constant."); | 138 internalError(node, "Factory constructor cannot be constant: $node."); |
| 139 } | 139 } |
| 140 | 140 |
| 141 applyParameters(NodeList parameters, _) { | 141 applyParameters(NodeList parameters, _) { |
| 142 computeParameterStructures(parameters).forEach((s) => s.dispatch(this, _)); | 142 computeParameterStructures(parameters).forEach((s) => s.dispatch(this, _)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 visitParameterDeclaration( | 145 visitParameterDeclaration( |
| 146 VariableDefinitions node, | 146 VariableDefinitions node, |
| 147 Node definition, | 147 Node definition, |
| 148 ParameterElement parameter, | 148 ParameterElement parameter, |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 return new IdenticalConstantExpression( | 369 return new IdenticalConstantExpression( |
| 370 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); | 370 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); |
| 371 } | 371 } |
| 372 | 372 |
| 373 @override | 373 @override |
| 374 ConstantExpression visitNamedArgument(NamedArgument node) { | 374 ConstantExpression visitNamedArgument(NamedArgument node) { |
| 375 return apply(node.expression); | 375 return apply(node.expression); |
| 376 } | 376 } |
| 377 } | 377 } |
| OLD | NEW |