mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:16:51 +00:00
[VM] A const bool.fromEnvironment() with an explicit defaultValue of null
should default to null
Closes https://github.com/dart-lang/sdk/issues/33628 Change-Id: I89ab411df0e113776364485ec9e2b6f7177dc024 Reviewed-on: https://dart-review.googlesource.com/63947 Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
1a08800dd6
commit
f5a3af4fcd
|
@ -47,8 +47,10 @@ class VmConstantsBackend implements ConstantsBackend {
|
|||
switch (nativeName) {
|
||||
case 'Bool_fromEnvironment':
|
||||
final String name = (positionalArguments[0] as StringConstant).value;
|
||||
final BoolConstant constant = namedArguments['defaultValue'];
|
||||
final bool defaultValue = constant != null ? constant.value : false;
|
||||
final Constant constant = namedArguments['defaultValue'];
|
||||
final bool defaultValue = constant is BoolConstant
|
||||
? constant.value
|
||||
: (constant is NullConstant ? null : false);
|
||||
bool value;
|
||||
if (defines != null) {
|
||||
value = defines[name] == 'true'
|
||||
|
|
|
@ -169,7 +169,6 @@ web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets
|
|||
[ $compiler == dartkp ]
|
||||
class_cycle_test/02: MissingCompileTimeError
|
||||
class_cycle_test/03: MissingCompileTimeError
|
||||
constant_string_interpolation2_test: DartkCrash # Issue 33628
|
||||
covariant_subtyping_test: RuntimeError
|
||||
duplicate_implements_test/01: MissingCompileTimeError
|
||||
duplicate_implements_test/02: MissingCompileTimeError
|
||||
|
|
Loading…
Reference in a new issue