| 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 // TODO(johnniwinther): Remove this library when all constant constructors are |
| 6 // computed during resolution. |
| 7 library dart2js.constants.constant_constructors; |
| 6 | 8 |
| 7 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
| 8 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| 9 import '../elements/elements.dart'; | 11 import '../elements/elements.dart'; |
| 10 import '../resolution/resolution.dart'; | 12 import '../resolution/resolution.dart'; |
| 11 import '../resolution/operators.dart'; | 13 import '../resolution/operators.dart'; |
| 12 import '../resolution/semantic_visitor.dart'; | 14 import '../resolution/semantic_visitor.dart'; |
| 13 import '../resolution/send_structure.dart'; | 15 import '../resolution/send_structure.dart'; |
| 14 import '../tree/tree.dart'; | 16 import '../tree/tree.dart'; |
| 15 import '../universe/universe.dart' show CallStructure; | 17 import '../universe/universe.dart' show CallStructure; |
| 18 import 'constructors.dart'; |
| 16 import 'expressions.dart'; | 19 import 'expressions.dart'; |
| 17 | 20 |
| 18 ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) { | 21 ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) { |
| 19 ConstantConstructorComputer visitor = | 22 ConstantConstructorComputer visitor = |
| 20 new ConstantConstructorComputer(resolvedAst.elements); | 23 new ConstantConstructorComputer(resolvedAst.elements); |
| 21 return resolvedAst.node.accept(visitor); | 24 return resolvedAst.node.accept(visitor); |
| 22 } | 25 } |
| 23 | 26 |
| 24 class ConstantConstructorComputer extends SemanticVisitor | 27 class ConstantConstructorComputer extends SemanticVisitor |
| 25 with SemanticDeclarationResolvedMixin, | 28 with SemanticDeclarationResolvedMixin, |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 371 } |
| 369 return new IdenticalConstantExpression( | 372 return new IdenticalConstantExpression( |
| 370 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); | 373 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); |
| 371 } | 374 } |
| 372 | 375 |
| 373 @override | 376 @override |
| 374 ConstantExpression visitNamedArgument(NamedArgument node) { | 377 ConstantExpression visitNamedArgument(NamedArgument node) { |
| 375 return apply(node.expression); | 378 return apply(node.expression); |
| 376 } | 379 } |
| 377 } | 380 } |
| OLD | NEW |