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.evaluation; | 5 library dart2js.constants.evaluation; |
6 | 6 |
7 import '../dart2jslib.dart' show Compiler; | 7 import '../compiler.dart' show |
8 import '../universe/universe.dart' show CallStructure; | 8 Compiler; |
| 9 import '../universe/universe.dart' show |
| 10 CallStructure; |
9 import 'expressions.dart'; | 11 import 'expressions.dart'; |
10 | 12 |
11 /// Environment used for evaluating constant expressions. | 13 /// Environment used for evaluating constant expressions. |
12 abstract class Environment { | 14 abstract class Environment { |
13 // TODO(johnniwinther): Replace this with [CoreTypes] and maybe [Backend]. | 15 // TODO(johnniwinther): Replace this with [CoreTypes] and maybe [Backend]. |
14 Compiler get compiler; | 16 Compiler get compiler; |
15 | 17 |
16 /// Read environments string passed in using the '-Dname=value' option. | 18 /// Read environments string passed in using the '-Dname=value' option. |
17 String readFromEnvironment(String name); | 19 String readFromEnvironment(String name); |
18 } | 20 } |
(...skipping 19 matching lines...) Expand all Loading... |
38 | 40 |
39 /// Returns the normalized [index]th positional argument. | 41 /// Returns the normalized [index]th positional argument. |
40 ConstantExpression getPositionalArgument(int index) { | 42 ConstantExpression getPositionalArgument(int index) { |
41 if (index >= callStructure.positionalArgumentCount) { | 43 if (index >= callStructure.positionalArgumentCount) { |
42 // The positional argument is not provided. | 44 // The positional argument is not provided. |
43 return defaultValues[index]; | 45 return defaultValues[index]; |
44 } | 46 } |
45 return arguments[index]; | 47 return arguments[index]; |
46 } | 48 } |
47 } | 49 } |
OLD | NEW |