| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /// A [ConstantEnvironment] provides access for constants compiled for variable | 7 /// A [ConstantEnvironment] provides access for constants compiled for variable |
| 8 /// initializers. | 8 /// initializers. |
| 9 abstract class ConstantEnvironment { | 9 abstract class ConstantEnvironment { |
| 10 /// Returns the constant for the initializer of [element]. | 10 /// Returns the constant for the initializer of [element]. |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 target.enclosingClass.name, target.name); | 669 target.enclosingClass.name, target.name); |
| 670 compiler.reportError( | 670 compiler.reportError( |
| 671 node, | 671 node, |
| 672 MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS, | 672 MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS, |
| 673 {'constructorName': name}); | 673 {'constructorName': name}); |
| 674 | 674 |
| 675 return new List<AstConstant>.filled( | 675 return new List<AstConstant>.filled( |
| 676 target.functionSignature.parameterCount, | 676 target.functionSignature.parameterCount, |
| 677 new ErroneousAstConstant(context, node)); | 677 new ErroneousAstConstant(context, node)); |
| 678 } | 678 } |
| 679 return selector.makeArgumentsList2(arguments, | 679 return selector.makeArgumentsList(arguments, |
| 680 target, | 680 target, |
| 681 compileArgument, | 681 compileArgument, |
| 682 compileDefaultValue); | 682 compileDefaultValue); |
| 683 } | 683 } |
| 684 | 684 |
| 685 AstConstant visitNewExpression(NewExpression node) { | 685 AstConstant visitNewExpression(NewExpression node) { |
| 686 if (!node.isConst) { | 686 if (!node.isConst) { |
| 687 return signalNotCompileTimeConstant(node); | 687 return signalNotCompileTimeConstant(node); |
| 688 } | 688 } |
| 689 | 689 |
| 690 Send send = node.send; | 690 Send send = node.send; |
| 691 FunctionElement constructor = elements[send]; | 691 FunctionElement constructor = elements[send]; |
| 692 if (Elements.isUnresolved(constructor)) { | 692 if (Elements.isUnresolved(constructor)) { |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 ConstantValue get value => expression.value; | 1117 ConstantValue get value => expression.value; |
| 1118 | 1118 |
| 1119 String toString() => expression.toString(); | 1119 String toString() => expression.toString(); |
| 1120 } | 1120 } |
| 1121 | 1121 |
| 1122 /// A synthetic constant used to recover from errors. | 1122 /// A synthetic constant used to recover from errors. |
| 1123 class ErroneousAstConstant extends AstConstant { | 1123 class ErroneousAstConstant extends AstConstant { |
| 1124 ErroneousAstConstant(Element element, Node node) | 1124 ErroneousAstConstant(Element element, Node node) |
| 1125 : super(element, node, new ErroneousConstantExpression()); | 1125 : super(element, node, new ErroneousConstantExpression()); |
| 1126 } | 1126 } |
| OLD | NEW |