| 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 // TODO(johnniwinther): Remove this library when all constant constructors are | 5 // TODO(johnniwinther): Remove this library when all constant constructors are |
| 6 // computed during resolution. | 6 // computed during resolution. |
| 7 library dart2js.constants.constant_constructors; | 7 library dart2js.constants.constant_constructors; |
| 8 | 8 |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../diagnostics/invariant.dart' show | 10 import '../diagnostics/invariant.dart' show |
| 11 invariant; | 11 invariant; |
| 12 import '../elements/elements.dart'; | 12 import '../elements/elements.dart'; |
| 13 import '../resolution/operators.dart'; | 13 import '../resolution/operators.dart'; |
| 14 import '../resolution/semantic_visitor.dart'; | 14 import '../resolution/semantic_visitor.dart'; |
| 15 import '../resolution/send_resolver.dart' show | 15 import '../resolution/send_resolver.dart' show |
| 16 DeclarationResolverMixin; | 16 DeclarationResolverMixin; |
| 17 import '../resolution/send_structure.dart'; | 17 import '../resolution/send_structure.dart'; |
| 18 import '../resolution/tree_elements.dart' show | 18 import '../resolution/tree_elements.dart' show |
| 19 TreeElements; | 19 TreeElements; |
| 20 import '../tree/tree.dart'; | 20 import '../tree/tree.dart'; |
| 21 import '../universe/universe.dart' show CallStructure; | 21 import '../universe/call_structure.dart' show |
| 22 CallStructure; |
| 22 import 'constructors.dart'; | 23 import 'constructors.dart'; |
| 23 import 'expressions.dart'; | 24 import 'expressions.dart'; |
| 24 | 25 |
| 25 ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) { | 26 ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) { |
| 26 ConstantConstructorComputer visitor = | 27 ConstantConstructorComputer visitor = |
| 27 new ConstantConstructorComputer(resolvedAst.elements); | 28 new ConstantConstructorComputer(resolvedAst.elements); |
| 28 return resolvedAst.node.accept(visitor); | 29 return resolvedAst.node.accept(visitor); |
| 29 } | 30 } |
| 30 | 31 |
| 31 class ConstantConstructorComputer extends SemanticVisitor | 32 class ConstantConstructorComputer extends SemanticVisitor |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 377 } |
| 377 return new IdenticalConstantExpression( | 378 return new IdenticalConstantExpression( |
| 378 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); | 379 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); |
| 379 } | 380 } |
| 380 | 381 |
| 381 @override | 382 @override |
| 382 ConstantExpression visitNamedArgument(NamedArgument node) { | 383 ConstantExpression visitNamedArgument(NamedArgument node) { |
| 383 return apply(node.expression); | 384 return apply(node.expression); |
| 384 } | 385 } |
| 385 } | 386 } |
| OLD | NEW |