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