diff --git a/tests/language_2/conditional_rewrite_test.dart b/tests/compiler/dart2js_extra/conditional_rewrite_test.dart similarity index 88% rename from tests/language_2/conditional_rewrite_test.dart rename to tests/compiler/dart2js_extra/conditional_rewrite_test.dart index 69a6398b429..57b0a42f213 100644 --- a/tests/language_2/conditional_rewrite_test.dart +++ b/tests/compiler/dart2js_extra/conditional_rewrite_test.dart @@ -13,9 +13,6 @@ posNull(x, y) => x != null ? y : null; negNull(x, y) => x != null ? !y : null; main() { - bool isCheckedMode = false; - assert((isCheckedMode = true)); - Expect.equals(false, posFalse(null, false)); Expect.equals(false, negFalse(null, false)); Expect.equals(null, posNull(null, false)); @@ -36,7 +33,7 @@ main() { Expect.equals(true, posNull([], true)); Expect.equals(false, negNull([], true)); - if (!isCheckedMode) { + if (isConditionCheckDisabled) { Expect.equals(null, posFalse([], null)); Expect.equals(true, negFalse([], null)); Expect.equals(null, posNull([], null)); @@ -49,3 +46,15 @@ main() { Expect.equals(true, negNull([], y)); } } + +bool get isConditionCheckDisabled { + bool b = null; + for (int i = 0; i < 3; i++) { + try { + b = !b; + } catch (e) { + return false; + } + } + return true; +} diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status index 22f9b5dc4ab..0d350679711 100644 --- a/tests/language_2/language_2_dart2js.status +++ b/tests/language_2/language_2_dart2js.status @@ -29,7 +29,6 @@ compile_time_constant_static5_test/11: CompileTimeError compile_time_constant_static5_test/16: CompileTimeError compile_time_constant_static5_test/21: CompileTimeError compile_time_constant_static5_test/23: CompileTimeError -conditional_rewrite_test: RuntimeError config_import_corelib_test: CompileTimeError # we need a special platform.dill file for categories=all. Once we fix that, all dart:* are supported when using '--categories=all' so this will become a RuntimeError, OK. config_import_test: RuntimeError # Test flag is not passed to the compiler. const_constructor3_test/04: MissingCompileTimeError # OK - Subtype check uses JS number semantics. diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index 77af32d91d7..8c9269bbc07 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -28,7 +28,6 @@ compile_time_constant_static5_test/21: CompileTimeError compile_time_constant_static5_test/23: CompileTimeError conditional_import_string_test: CompileTimeError conditional_import_test: CompileTimeError -conditional_rewrite_test: RuntimeError config_import_corelib_test: CompileTimeError config_import_test: RuntimeError const_list_test: RuntimeError @@ -808,7 +807,6 @@ regress_22728_test: RuntimeError [ $compiler == dartkp && $runtime == dart_precompiled && !$checked ] assertion_initializer_const_error_test/01: MissingCompileTimeError assertion_initializer_const_function_error_test/01: MissingCompileTimeError -conditional_rewrite_test: RuntimeError # Issue 31402 (Not) implicit_downcast_during_combiner_test: RuntimeError implicit_downcast_during_compound_assignment_test: RuntimeError implicit_downcast_during_conditional_expression_test: RuntimeError @@ -879,7 +877,6 @@ malbounded_type_test_test/04: Fail regress_30339_test: RuntimeError [ $runtime == vm && !$checked && ($compiler == dartk || $compiler == dartkb) ] -conditional_rewrite_test: RuntimeError # Issue 31402 (Not) type_error_test: RuntimeError # Issue 31402 (Variable declaration) # ===== dartk + vm status lines =====