OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'configuration.dart'; | 5 import 'configuration.dart'; |
6 | 6 |
7 typedef String _LookUpFunction(Configuration configuration); | 7 typedef String _LookUpFunction(Configuration configuration); |
8 typedef bool _BoolLookUpFunction(Configuration configuration); | 8 typedef bool _BoolLookUpFunction(Configuration configuration); |
9 | 9 |
10 // TODO(29756): Instead of synthesized negated variables like "unchecked", | 10 // TODO(29756): Instead of synthesized negated variables like "unchecked", |
11 // consider adding support for "!" to status expressions. | 11 // consider adding support for "!" to status expressions. |
12 final _variables = { | 12 final _variables = { |
13 "analyzer": new _Variable.bool((c) => c.compiler == Compiler.dart2analyzer), | 13 "analyzer": new _Variable.bool((c) => c.compiler == Compiler.dart2analyzer), |
14 "arch": new _Variable((c) => c.architecture.name, Architecture.names), | 14 "arch": new _Variable((c) => c.architecture.name, Architecture.names), |
15 "browser": new _Variable.bool((c) => c.runtime.isBrowser), | 15 "browser": new _Variable.bool((c) => c.runtime.isBrowser), |
16 "builder_tag": new _Variable((c) => c.builderTag ?? "", const []), | 16 "builder_tag": new _Variable((c) => c.builderTag ?? "", const []), |
17 "checked": new _Variable.bool((c) => c.isChecked), | 17 "checked": new _Variable.bool((c) => c.isChecked), |
18 "compiler": new _Variable((c) => c.compiler.name, Compiler.names), | 18 "compiler": new _Variable((c) => c.compiler.name, Compiler.names), |
19 "csp": new _Variable.bool((c) => c.isCsp), | 19 "csp": new _Variable.bool((c) => c.isCsp), |
20 "dart2js_with_kernel": new _Variable.bool((c) => c.useDart2JSWithKernel), | 20 "dart2js_with_kernel": new _Variable.bool((c) => c.useDart2JSWithKernel), |
| 21 "dart2js_with_kernel_in_ssa": |
| 22 new _Variable.bool((c) => c.useDart2JSWithKernelInSsa), |
21 "fast_startup": new _Variable.bool((c) => c.useFastStartup), | 23 "fast_startup": new _Variable.bool((c) => c.useFastStartup), |
22 "enable_asserts": new _Variable.bool((c) => c.useEnableAsserts), | 24 "enable_asserts": new _Variable.bool((c) => c.useEnableAsserts), |
23 "host_checked": new _Variable.bool((c) => c.isHostChecked), | 25 "host_checked": new _Variable.bool((c) => c.isHostChecked), |
24 "host_unchecked": new _Variable.bool((c) => !c.isHostChecked), | 26 "host_unchecked": new _Variable.bool((c) => !c.isHostChecked), |
25 "hot_reload": new _Variable.bool((c) => c.hotReload), | 27 "hot_reload": new _Variable.bool((c) => c.hotReload), |
26 "hot_reload_rollback": new _Variable.bool((c) => c.hotReloadRollback), | 28 "hot_reload_rollback": new _Variable.bool((c) => c.hotReloadRollback), |
27 "ie": new _Variable.bool((c) => c.runtime.isIE), | 29 "ie": new _Variable.bool((c) => c.runtime.isIE), |
28 "jscl": new _Variable.bool((c) => c.runtime.isJSCommandLine), | 30 "jscl": new _Variable.bool((c) => c.runtime.isJSCommandLine), |
29 "minified": new _Variable.bool((c) => c.isMinified), | 31 "minified": new _Variable.bool((c) => c.isMinified), |
30 "mode": new _Variable((c) => c.mode.name, Mode.names), | 32 "mode": new _Variable((c) => c.mode.name, Mode.names), |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 _Variable(this._lookUp, Iterable<String> allowed) | 107 _Variable(this._lookUp, Iterable<String> allowed) |
106 : allowedValues = allowed.toList(); | 108 : allowedValues = allowed.toList(); |
107 | 109 |
108 /// Creates a Boolean variable with allowed values "true" and "false". | 110 /// Creates a Boolean variable with allowed values "true" and "false". |
109 _Variable.bool(_BoolLookUpFunction lookUp) | 111 _Variable.bool(_BoolLookUpFunction lookUp) |
110 : _lookUp = ((configuration) => lookUp(configuration).toString()), | 112 : _lookUp = ((configuration) => lookUp(configuration).toString()), |
111 allowedValues = const ["true", "false"]; | 113 allowedValues = const ["true", "false"]; |
112 | 114 |
113 String lookUp(Configuration configuration) => _lookUp(configuration); | 115 String lookUp(Configuration configuration) => _lookUp(configuration); |
114 } | 116 } |
OLD | NEW |