| 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 library dart2js.compile_time_constant_evaluator; | 5 library dart2js.compile_time_constant_evaluator; |
| 6 | 6 |
| 7 import 'constant_system_dart.dart'; | 7 import 'constant_system_dart.dart'; |
| 8 import 'constants/constant_system.dart'; | 8 import 'constants/constant_system.dart'; |
| 9 import 'constants/expressions.dart'; | 9 import 'constants/expressions.dart'; |
| 10 import 'constants/values.dart'; | 10 import 'constants/values.dart'; |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 // and present some kind of stack-trace. | 975 // and present some kind of stack-trace. |
| 976 compiler.reportError(node, message); | 976 compiler.reportError(node, message); |
| 977 } | 977 } |
| 978 | 978 |
| 979 AstConstant signalNotCompileTimeConstant(Node node, | 979 AstConstant signalNotCompileTimeConstant(Node node, |
| 980 {MessageKind message: MessageKind.NOT_A_COMPILE_TIME_CONSTANT}) { | 980 {MessageKind message: MessageKind.NOT_A_COMPILE_TIME_CONSTANT}) { |
| 981 if (isEvaluatingConstant) { | 981 if (isEvaluatingConstant) { |
| 982 error(node, message); | 982 error(node, message); |
| 983 | 983 |
| 984 return new AstConstant( | 984 return new AstConstant( |
| 985 null, node, new NullConstantExpression(new NullConstantValue())); | 985 null, node, new ErroneousConstantExpression()); |
| 986 } | 986 } |
| 987 // Else we don't need to do anything. The final handler is only | 987 // Else we don't need to do anything. The final handler is only |
| 988 // optimistically trying to compile constants. So it is normal that we | 988 // optimistically trying to compile constants. So it is normal that we |
| 989 // sometimes see non-compile time constants. | 989 // sometimes see non-compile time constants. |
| 990 // Simply return [:null:] which is used to propagate a failing | 990 // Simply return [:null:] which is used to propagate a failing |
| 991 // compile-time compilation. | 991 // compile-time compilation. |
| 992 return null; | 992 return null; |
| 993 } | 993 } |
| 994 } | 994 } |
| 995 | 995 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 ErroneousAstConstant(Element element, Node node) | 1233 ErroneousAstConstant(Element element, Node node) |
| 1234 : super(element, node, new ErroneousConstantExpression()); | 1234 : super(element, node, new ErroneousConstantExpression()); |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 // TODO(johnniwinther): Avoid the need for this hack. | 1237 // TODO(johnniwinther): Avoid the need for this hack. |
| 1238 TreeElements _analyzeElementEagerly(Compiler compiler, AstElement element) { | 1238 TreeElements _analyzeElementEagerly(Compiler compiler, AstElement element) { |
| 1239 WorldImpact worldImpact = compiler.analyzeElement(element.declaration); | 1239 WorldImpact worldImpact = compiler.analyzeElement(element.declaration); |
| 1240 compiler.enqueuer.resolution.applyImpact(element.declaration, worldImpact); | 1240 compiler.enqueuer.resolution.applyImpact(element.declaration, worldImpact); |
| 1241 return element.resolvedAst.elements; | 1241 return element.resolvedAst.elements; |
| 1242 } | 1242 } |
| OLD | NEW |