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'; |
11 import '../resolution/operators.dart'; | 11 import '../resolution/operators.dart'; |
12 import '../resolution/semantic_visitor.dart'; | 12 import '../resolution/semantic_visitor.dart'; |
13 import '../resolution/send_structure.dart'; | 13 import '../resolution/send_structure.dart'; |
14 import '../tree/tree.dart'; | 14 import '../tree/tree.dart'; |
15 import '../universe/universe.dart' show CallStructure; | 15 import '../universe/universe.dart' show CallStructure; |
16 import 'expressions.dart'; | 16 import 'expressions.dart'; |
17 import 'values.dart'; | |
18 | 17 |
19 ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) { | 18 ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) { |
20 ConstantConstructorComputer visitor = | 19 ConstantConstructorComputer visitor = |
21 new ConstantConstructorComputer(resolvedAst.elements); | 20 new ConstantConstructorComputer(resolvedAst.elements); |
22 return resolvedAst.node.accept(visitor); | 21 return resolvedAst.node.accept(visitor); |
23 } | 22 } |
24 | 23 |
25 class ConstantConstructorComputer extends SemanticVisitor | 24 class ConstantConstructorComputer extends SemanticVisitor |
26 with SemanticDeclarationResolvedMixin, | 25 with SemanticDeclarationResolvedMixin, |
27 DeclarationResolverMixin, | 26 DeclarationResolverMixin, |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 368 } |
370 return new IdenticalConstantExpression( | 369 return new IdenticalConstantExpression( |
371 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); | 370 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); |
372 } | 371 } |
373 | 372 |
374 @override | 373 @override |
375 ConstantExpression visitNamedArgument(NamedArgument node) { | 374 ConstantExpression visitNamedArgument(NamedArgument node) { |
376 return apply(node.expression); | 375 return apply(node.expression); |
377 } | 376 } |
378 } | 377 } |
OLD | NEW |