| 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 'common/resolution.dart' show Resolution; | 7 import 'common/resolution.dart' show Resolution; |
| 8 import 'common/tasks.dart' show CompilerTask, Measurer; | 8 import 'common/tasks.dart' show CompilerTask, Measurer; |
| 9 import 'common.dart'; | 9 import 'common.dart'; |
| 10 import 'compiler.dart' show Compiler; | 10 import 'compiler.dart' show Compiler; |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 class ErroneousAstConstant extends AstConstant { | 1435 class ErroneousAstConstant extends AstConstant { |
| 1436 ErroneousAstConstant(Element element, Node node) | 1436 ErroneousAstConstant(Element element, Node node) |
| 1437 : super( | 1437 : super( |
| 1438 element, | 1438 element, |
| 1439 node, | 1439 node, |
| 1440 // TODO(johnniwinther): Return a [NonConstantValue] instead. | 1440 // TODO(johnniwinther): Return a [NonConstantValue] instead. |
| 1441 new ErroneousConstantExpression(), | 1441 new ErroneousConstantExpression(), |
| 1442 new NullConstantValue()); | 1442 new NullConstantValue()); |
| 1443 } | 1443 } |
| 1444 | 1444 |
| 1445 class _CompilerEnvironment implements Environment { | 1445 class _CompilerEnvironment implements EvaluationEnvironment { |
| 1446 final Compiler _compiler; | 1446 final Compiler _compiler; |
| 1447 | 1447 |
| 1448 _CompilerEnvironment(this._compiler); | 1448 _CompilerEnvironment(this._compiler); |
| 1449 | 1449 |
| 1450 @override | 1450 @override |
| 1451 CommonElements get commonElements => _compiler.commonElements; | 1451 CommonElements get commonElements => _compiler.commonElements; |
| 1452 | 1452 |
| 1453 @override | 1453 @override |
| 1454 String readFromEnvironment(String name) { | 1454 String readFromEnvironment(String name) { |
| 1455 return _compiler.fromEnvironment(name); | 1455 return _compiler.fromEnvironment(name); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1469 @override | 1469 @override |
| 1470 ConstantExpression getFieldConstant(FieldElement field) { | 1470 ConstantExpression getFieldConstant(FieldElement field) { |
| 1471 return field.constant; | 1471 return field.constant; |
| 1472 } | 1472 } |
| 1473 | 1473 |
| 1474 @override | 1474 @override |
| 1475 ConstantExpression getLocalConstant(LocalVariableElement local) { | 1475 ConstantExpression getLocalConstant(LocalVariableElement local) { |
| 1476 return local.constant; | 1476 return local.constant; |
| 1477 } | 1477 } |
| 1478 } | 1478 } |
| OLD | NEW |