diff --git a/pkg/compiler/lib/src/kernel/dart2js_target.dart b/pkg/compiler/lib/src/kernel/dart2js_target.dart index e63942d3b6c..592149ebb95 100644 --- a/pkg/compiler/lib/src/kernel/dart2js_target.dart +++ b/pkg/compiler/lib/src/kernel/dart2js_target.dart @@ -42,8 +42,9 @@ const Iterable _allowedDartSchemePaths = [ List _allowedNativeTestPatterns = [ RegExp(r'(? bool get checkedImplicitDowncasts => !const bool.fromEnvironment('dart.tool.dart2js.types:trust'); +/// Whether RTI optimizations are disabled at compile time. +/// +/// This can cause some type errors to present differently than they otherwise +/// would. For example, when these optimizations are disabled ArgumentErrors may +/// present as TypeErrors instead. +bool get rtiOptimizationsDisabled => + const bool.fromEnvironment('dart.tool.dart2js.disable_rti_optimization', + defaultValue: true); + /// Whether explicit casts are type checked at runtime. /// /// An expression like `e as String` should perform a runtime check that the diff --git a/tests/web/bounds_check4a_test.dart b/tests/web/bounds_check4a_test.dart index 49e8d42f84c..0ecacb1173a 100644 --- a/tests/web/bounds_check4a_test.dart +++ b/tests/web/bounds_check4a_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong +// dart2jsOptions=-O1 import 'package:expect/expect.dart'; diff --git a/tests/web/bounds_check4b_test.dart b/tests/web/bounds_check4b_test.dart index fdb78637773..2b9b0807cb3 100644 --- a/tests/web/bounds_check4b_test.dart +++ b/tests/web/bounds_check4b_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong +// dart2jsOptions=-O1 import 'package:expect/expect.dart'; diff --git a/tests/web/checked_setter_test.dart b/tests/web/checked_setter_test.dart index 0f379820a5f..255df9449ff 100644 --- a/tests/web/checked_setter_test.dart +++ b/tests/web/checked_setter_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + // Formatting can break multitests, so don't format them. // dart format off diff --git a/tests/web/conditional_rewrite_test.dart b/tests/web/conditional_rewrite_test.dart index 12a162045c1..c8ba4be801c 100644 --- a/tests/web/conditional_rewrite_test.dart +++ b/tests/web/conditional_rewrite_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; // Test that dart2js does not rewrite conditional into logical operators diff --git a/tests/web/consistent_add_error_test.dart b/tests/web/consistent_add_error_test.dart index 4559ce4dd11..e5c54da6510 100644 --- a/tests/web/consistent_add_error_test.dart +++ b/tests/web/consistent_add_error_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; // Test that optimized '+' and slow path '+' produce the same error. diff --git a/tests/web/consistent_codeUnitAt_error_test.dart b/tests/web/consistent_codeUnitAt_error_test.dart index b90a68ad8d9..7dd9d107410 100644 --- a/tests/web/consistent_codeUnitAt_error_test.dart +++ b/tests/web/consistent_codeUnitAt_error_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; // Test that optimized codeUnitAt and slow path codeUnitAt produce the same diff --git a/tests/web/consistent_type_error_test.dart b/tests/web/consistent_type_error_test.dart index e687ba46736..81d76bc0443 100644 --- a/tests/web/consistent_type_error_test.dart +++ b/tests/web/consistent_type_error_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + // Test that type checks give consistent errors for the same types. In minified // mode this checks that the minified class names are consistently tagged. diff --git a/tests/web/internal/array_flags_errors_test.dart b/tests/web/dart2js/array_flags_errors_test.dart similarity index 100% rename from tests/web/internal/array_flags_errors_test.dart rename to tests/web/dart2js/array_flags_errors_test.dart diff --git a/tests/web/assert_with_message_test.dart b/tests/web/dart2js/assert_with_message_test.dart similarity index 100% rename from tests/web/assert_with_message_test.dart rename to tests/web/dart2js/assert_with_message_test.dart diff --git a/tests/web/code_motion_exception_test.dart b/tests/web/dart2js/code_motion_exception_test.dart similarity index 84% rename from tests/web/code_motion_exception_test.dart rename to tests/web/dart2js/code_motion_exception_test.dart index e7fb5946c72..ef88e98667c 100644 --- a/tests/web/code_motion_exception_test.dart +++ b/tests/web/dart2js/code_motion_exception_test.dart @@ -5,6 +5,7 @@ // dart2jsOptions=--no-minify import "package:expect/expect.dart"; +import "package:expect/variations.dart"; // Test for correct order of exceptions in code with checks that could be moved // merged from successors into a dominator. @@ -45,7 +46,11 @@ test1() { gA = null; gB = 2; - Expect.throws(call1, (e) => e is ArgumentError, 'foo1($gA, $gB) AE'); + Expect.throws( + call1, + (e) => rtiOptimizationsDisabled ? e is TypeError : e is ArgumentError, + 'foo1($gA, $gB) AE', + ); } foo2a(a, b) { @@ -101,8 +106,16 @@ test2() { gA = 1; gB = null; - Expect.throws(call2a, (e) => e is ArgumentError, 'foo2($gA, $gB) AE'); - Expect.throws(call2b, (e) => e is ArgumentError, 'foo2($gA, $gB) AE'); + Expect.throws( + call2a, + (e) => rtiOptimizationsDisabled ? e is TypeError : e is ArgumentError, + 'foo2($gA, $gB) AE', + ); + Expect.throws( + call2b, + (e) => rtiOptimizationsDisabled ? e is TypeError : e is ArgumentError, + 'foo2($gA, $gB) AE', + ); gA = null; gB = 2; diff --git a/tests/web/constant_folding_test.dart b/tests/web/dart2js/constant_folding_test.dart similarity index 100% rename from tests/web/constant_folding_test.dart rename to tests/web/dart2js/constant_folding_test.dart diff --git a/tests/web/data_uri_test.dart b/tests/web/dart2js/data_uri_test.dart similarity index 100% rename from tests/web/data_uri_test.dart rename to tests/web/dart2js/data_uri_test.dart diff --git a/tests/web/deferred/deferred_class_test.dart b/tests/web/dart2js/deferred/deferred_class_test.dart similarity index 93% rename from tests/web/deferred/deferred_class_test.dart rename to tests/web/dart2js/deferred/deferred_class_test.dart index 9a992dedfc7..6f1adbba102 100644 --- a/tests/web/deferred/deferred_class_test.dart +++ b/tests/web/dart2js/deferred/deferred_class_test.dart @@ -7,7 +7,7 @@ import 'package:expect/expect.dart'; import 'dart:async'; -import 'deferred_class_library.dart' deferred as lib; +import '../../deferred/deferred_class_library.dart' deferred as lib; bool isError(e) => e is Error; diff --git a/tests/web/deferred/deferred_function_test.dart b/tests/web/dart2js/deferred/deferred_function_test.dart similarity index 93% rename from tests/web/deferred/deferred_function_test.dart rename to tests/web/dart2js/deferred/deferred_function_test.dart index bf465ce11c1..b4796cef99f 100644 --- a/tests/web/deferred/deferred_function_test.dart +++ b/tests/web/dart2js/deferred/deferred_function_test.dart @@ -8,7 +8,7 @@ import 'package:expect/async_helper.dart'; import 'package:expect/expect.dart'; -import 'deferred_function_library.dart' deferred as lib; +import '../../deferred/deferred_function_library.dart' deferred as lib; bool isError(e) => e is Error; diff --git a/tests/web/deferred/trusted_script_url/lib.dart b/tests/web/dart2js/deferred/trusted_script_url/lib.dart similarity index 100% rename from tests/web/deferred/trusted_script_url/lib.dart rename to tests/web/dart2js/deferred/trusted_script_url/lib.dart diff --git a/tests/web/deferred/trusted_script_url/trusted_script_url_test.dart b/tests/web/dart2js/deferred/trusted_script_url/trusted_script_url_test.dart similarity index 100% rename from tests/web/deferred/trusted_script_url/trusted_script_url_test.dart rename to tests/web/dart2js/deferred/trusted_script_url/trusted_script_url_test.dart diff --git a/tests/web/deferred/trusted_script_url/trusted_script_url_test.html b/tests/web/dart2js/deferred/trusted_script_url/trusted_script_url_test.html similarity index 100% rename from tests/web/deferred/trusted_script_url/trusted_script_url_test.html rename to tests/web/dart2js/deferred/trusted_script_url/trusted_script_url_test.html diff --git a/tests/web/deferred_fail_and_retry_lib.dart b/tests/web/dart2js/deferred_fail_and_retry_lib.dart similarity index 100% rename from tests/web/deferred_fail_and_retry_lib.dart rename to tests/web/dart2js/deferred_fail_and_retry_lib.dart diff --git a/tests/web/deferred_fail_and_retry_test.dart b/tests/web/dart2js/deferred_fail_and_retry_test.dart similarity index 100% rename from tests/web/deferred_fail_and_retry_test.dart rename to tests/web/dart2js/deferred_fail_and_retry_test.dart diff --git a/tests/web/internal/deferred_url_test.dart b/tests/web/dart2js/deferred_url_test.dart similarity index 100% rename from tests/web/internal/deferred_url_test.dart rename to tests/web/dart2js/deferred_url_test.dart diff --git a/tests/web/deferred_with_cross_origin_lib.dart b/tests/web/dart2js/deferred_with_cross_origin_lib.dart similarity index 100% rename from tests/web/deferred_with_cross_origin_lib.dart rename to tests/web/dart2js/deferred_with_cross_origin_lib.dart diff --git a/tests/web/deferred_with_cross_origin_test.dart b/tests/web/dart2js/deferred_with_cross_origin_test.dart similarity index 100% rename from tests/web/deferred_with_cross_origin_test.dart rename to tests/web/dart2js/deferred_with_cross_origin_test.dart diff --git a/tests/web/deferred_with_csp_nonce2_test.dart b/tests/web/dart2js/deferred_with_csp_nonce2_test.dart similarity index 100% rename from tests/web/deferred_with_csp_nonce2_test.dart rename to tests/web/dart2js/deferred_with_csp_nonce2_test.dart diff --git a/tests/web/deferred_with_csp_nonce_lib.dart b/tests/web/dart2js/deferred_with_csp_nonce_lib.dart similarity index 100% rename from tests/web/deferred_with_csp_nonce_lib.dart rename to tests/web/dart2js/deferred_with_csp_nonce_lib.dart diff --git a/tests/web/deferred_with_csp_nonce_test.dart b/tests/web/dart2js/deferred_with_csp_nonce_test.dart similarity index 100% rename from tests/web/deferred_with_csp_nonce_test.dart rename to tests/web/dart2js/deferred_with_csp_nonce_test.dart diff --git a/tests/web/internal/lax_runtime_type_closure_to_string1_test.dart b/tests/web/dart2js/lax_runtime_type_closure_to_string1_test.dart similarity index 72% rename from tests/web/internal/lax_runtime_type_closure_to_string1_test.dart rename to tests/web/dart2js/lax_runtime_type_closure_to_string1_test.dart index dcf23aa19af..41198d5c9bc 100644 --- a/tests/web/internal/lax_runtime_type_closure_to_string1_test.dart +++ b/tests/web/dart2js/lax_runtime_type_closure_to_string1_test.dart @@ -2,9 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong --omit-implicit-checks --lax-runtime-type-to-string +// dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string import 'package:expect/expect.dart'; +import 'package:expect/variations.dart'; import 'dart:_foreign_helper' show JS_GET_FLAG; class Class { @@ -17,7 +18,9 @@ main() { var toString = '${local1.runtimeType}'; if (!toString.contains('minified:')) { - Expect.equals("Closure0Args", toString); + if (!rtiOptimizationsDisabled) { + Expect.equals("Closure0Args", toString); + } } print(toString); local2(0); diff --git a/tests/web/internal/lax_runtime_type_closure_to_string2_test.dart b/tests/web/dart2js/lax_runtime_type_closure_to_string2_test.dart similarity index 72% rename from tests/web/internal/lax_runtime_type_closure_to_string2_test.dart rename to tests/web/dart2js/lax_runtime_type_closure_to_string2_test.dart index bd37f119d7b..f973e10442c 100644 --- a/tests/web/internal/lax_runtime_type_closure_to_string2_test.dart +++ b/tests/web/dart2js/lax_runtime_type_closure_to_string2_test.dart @@ -2,9 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong --omit-implicit-checks --lax-runtime-type-to-string +// dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string import 'package:expect/expect.dart'; +import 'package:expect/variations.dart'; import 'dart:_foreign_helper' show JS_GET_FLAG; class Class { @@ -17,7 +18,9 @@ main() { var toString = '${local1.runtimeType}'; if (!toString.contains('minified:')) { - Expect.equals("Closure", toString); + if (!rtiOptimizationsDisabled) { + Expect.equals("Closure", toString); + } } print(toString); local2(0); diff --git a/tests/web/lax_runtime_type_closure_to_string3_test.dart b/tests/web/dart2js/lax_runtime_type_closure_to_string3_test.dart similarity index 76% rename from tests/web/lax_runtime_type_closure_to_string3_test.dart rename to tests/web/dart2js/lax_runtime_type_closure_to_string3_test.dart index 3c4d521fa67..a6802187e20 100644 --- a/tests/web/lax_runtime_type_closure_to_string3_test.dart +++ b/tests/web/dart2js/lax_runtime_type_closure_to_string3_test.dart @@ -5,6 +5,7 @@ // dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string import 'package:expect/expect.dart'; +import 'package:expect/variations.dart'; class Class1 { Class1(); @@ -18,6 +19,8 @@ class Class2 { main() { Class1 cls1 = Class1(); - Expect.equals("() => erased", cls1.method.runtimeType.toString()); + if (!rtiOptimizationsDisabled) { + Expect.equals("() => erased", cls1.method.runtimeType.toString()); + } Class2(); } diff --git a/tests/web/internal/lax_runtime_type_closure_to_string7_test.dart b/tests/web/dart2js/lax_runtime_type_closure_to_string7_test.dart similarity index 80% rename from tests/web/internal/lax_runtime_type_closure_to_string7_test.dart rename to tests/web/dart2js/lax_runtime_type_closure_to_string7_test.dart index 5fb28c0b041..825cd8a6191 100644 --- a/tests/web/internal/lax_runtime_type_closure_to_string7_test.dart +++ b/tests/web/dart2js/lax_runtime_type_closure_to_string7_test.dart @@ -5,6 +5,7 @@ // dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string import 'package:expect/expect.dart'; +import 'package:expect/variations.dart'; import 'dart:_foreign_helper' show JS_GET_FLAG; class Class { @@ -18,8 +19,10 @@ test() { var toString = '${local1.runtimeType}'; if (!toString.contains('minified:')) { - // `true` if non-minified. - Expect.equals("Closure", toString); + if (!rtiOptimizationsDisabled) { + // `true` if non-minified. + Expect.equals("Closure", toString); + } } print(toString); local2(0); diff --git a/tests/web/lax_runtime_type_instantiate_to_string_test.dart b/tests/web/dart2js/lax_runtime_type_instantiate_to_string_test.dart similarity index 77% rename from tests/web/lax_runtime_type_instantiate_to_string_test.dart rename to tests/web/dart2js/lax_runtime_type_instantiate_to_string_test.dart index 2b4088fa37b..65fb86a0cde 100644 --- a/tests/web/lax_runtime_type_instantiate_to_string_test.dart +++ b/tests/web/dart2js/lax_runtime_type_instantiate_to_string_test.dart @@ -2,9 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong --omit-implicit-checks --lax-runtime-type-to-string +// dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string import 'package:expect/expect.dart'; +import 'package:expect/variations.dart'; main() { T id(T t) => t; @@ -16,7 +17,9 @@ main() { // The type parameter is present since it is required because `==` // distinguishes instantiations of the same generic function with different // types. - Expect.equals("Instantiation1", toString); + if (!rtiOptimizationsDisabled) { + Expect.equals("Instantiation1", toString); + } } print(toString); } diff --git a/tests/web/internal/platform_environment_variable1_test.dart b/tests/web/dart2js/platform_environment_variable1_test.dart similarity index 100% rename from tests/web/internal/platform_environment_variable1_test.dart rename to tests/web/dart2js/platform_environment_variable1_test.dart diff --git a/tests/web/internal/platform_environment_variable2_test.dart b/tests/web/dart2js/platform_environment_variable2_test.dart similarity index 100% rename from tests/web/internal/platform_environment_variable2_test.dart rename to tests/web/dart2js/platform_environment_variable2_test.dart diff --git a/tests/web/regress/issue/32969_test.dart b/tests/web/dart2js/regress/issue/32969_test.dart similarity index 100% rename from tests/web/regress/issue/32969_test.dart rename to tests/web/dart2js/regress/issue/32969_test.dart diff --git a/tests/web/internal/rti/runtime_type_3_test.dart b/tests/web/dart2js/runtime_type_3_test.dart similarity index 100% rename from tests/web/internal/rti/runtime_type_3_test.dart rename to tests/web/dart2js/runtime_type_3_test.dart diff --git a/tests/web/dart2js/runtime_type_to_string1_test.dart b/tests/web/dart2js/runtime_type_to_string1_test.dart new file mode 100644 index 00000000000..cf9101842f1 --- /dev/null +++ b/tests/web/dart2js/runtime_type_to_string1_test.dart @@ -0,0 +1,30 @@ +// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string + +import 'package:expect/expect.dart'; +import 'package:expect/variations.dart'; + +class Class { + Class(); +} + +main() { + // Since the type argument of `Class` is only needed for + // `.runtimeType.toString()`, it is not reified, and the toString is therefore + // 'Class' (when dart2js RTI optimizations are enabled). + String className = (Class).toString(); + className = className.substring(0, className.indexOf('<')); + final defaultTypeToString = new Class().runtimeType.toString(); + final instantiatedToString = new Class().runtimeType.toString(); + if (!rtiOptimizationsDisabled) { + String erasedName = '$className'; + Expect.equals(erasedName, defaultTypeToString); + Expect.equals(erasedName, instantiatedToString); + } else { + Expect.equals('$className', defaultTypeToString); + Expect.equals('$className', instantiatedToString); + } +} diff --git a/tests/web/internal/rti/subtype_test.dart b/tests/web/dart2js/subtype_test.dart similarity index 99% rename from tests/web/internal/rti/subtype_test.dart rename to tests/web/dart2js/subtype_test.dart index 0b030d55435..18f66c45197 100644 --- a/tests/web/internal/rti/subtype_test.dart +++ b/tests/web/dart2js/subtype_test.dart @@ -8,7 +8,7 @@ import 'dart:_rti' as rti; import 'package:expect/expect.dart'; import 'package:expect/variations.dart'; -import 'subtype_utils.dart'; +import '../internal/rti/subtype_utils.dart'; final String objectName = JS_GET_NAME(JsGetName.OBJECT_CLASS_TYPE_NAME); final String futureName = JS_GET_NAME(JsGetName.FUTURE_CLASS_TYPE_NAME); diff --git a/tests/web/truncation_errors_test.dart b/tests/web/dart2js/truncation_errors_test.dart similarity index 100% rename from tests/web/truncation_errors_test.dart rename to tests/web/dart2js/truncation_errors_test.dart diff --git a/tests/web/useful_error_message_1_test.dart b/tests/web/dart2js/useful_error_message_1_test.dart similarity index 100% rename from tests/web/useful_error_message_1_test.dart rename to tests/web/dart2js/useful_error_message_1_test.dart diff --git a/tests/web/dynamic_bounds_check_test.dart b/tests/web/dynamic_bounds_check_test.dart index 9593aeac257..66ae6c3656b 100644 --- a/tests/web/dynamic_bounds_check_test.dart +++ b/tests/web/dynamic_bounds_check_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; class Foo {} diff --git a/tests/web/generic_bounds_test.dart b/tests/web/generic_bounds_test.dart index 0b9cacbb00a..6ebe824e5a8 100644 --- a/tests/web/generic_bounds_test.dart +++ b/tests/web/generic_bounds_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong +// dart2jsOptions=-O1 import 'package:expect/expect.dart'; diff --git a/tests/web/injected_cast_test.dart b/tests/web/injected_cast_test.dart index 4413de3e482..2b7a757bb95 100644 --- a/tests/web/injected_cast_test.dart +++ b/tests/web/injected_cast_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import 'package:expect/expect.dart'; var field; diff --git a/tests/web/internal/rti/required_named_parameters_test.dart b/tests/web/internal/rti/required_named_parameters_test.dart index 9229e482c72..0f2bfd8b52e 100644 --- a/tests/web/internal/rti/required_named_parameters_test.dart +++ b/tests/web/internal/rti/required_named_parameters_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=--no-minify + import 'dart:_rti' as rti; import 'dart:_foreign_helper' show JS; import "package:expect/expect.dart"; diff --git a/tests/web/internal/rti/simple_type_bound_test.dart b/tests/web/internal/rti/simple_type_bound_test.dart index 6268d0ec347..b13636b9d23 100644 --- a/tests/web/internal/rti/simple_type_bound_test.dart +++ b/tests/web/internal/rti/simple_type_bound_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; @pragma('dart2js:noInline') diff --git a/tests/web/regress/issue/4515_1_test.dart b/tests/web/regress/issue/4515_1_test.dart index 8c758b00414..8f6e51c2a5d 100644 --- a/tests/web/regress/issue/4515_1_test.dart +++ b/tests/web/regress/issue/4515_1_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; class A { diff --git a/tests/web/regress/issue/4515_2_test.dart b/tests/web/regress/issue/4515_2_test.dart index 34116485c17..9d95047bdd8 100644 --- a/tests/web/regress/issue/4515_2_test.dart +++ b/tests/web/regress/issue/4515_2_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; class A { diff --git a/tests/web/regress/issue/4515_3_test.dart b/tests/web/regress/issue/4515_3_test.dart index 23438ad7ce2..64b8d311a24 100644 --- a/tests/web/regress/issue/4515_3_test.dart +++ b/tests/web/regress/issue/4515_3_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; class A { diff --git a/tests/web/regress/issue/52582_test.dart b/tests/web/regress/issue/52582_test.dart index d21f3df4bfb..cf4ba37bca1 100644 --- a/tests/web/regress/issue/52582_test.dart +++ b/tests/web/regress/issue/52582_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import 'package:expect/expect.dart'; class A { diff --git a/tests/web/runtime_type_test.dart b/tests/web/runtime_type_test.dart index a986bfa55e5..7d8bc888927 100644 --- a/tests/web/runtime_type_test.dart +++ b/tests/web/runtime_type_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// dart2jsOptions=--strong --no-minify +// dart2jsOptions=-O1 --no-minify // Test that Type.toString returns nice strings for native classes with // reserved names and for raw types. diff --git a/tests/web/runtime_type_to_string1_test.dart b/tests/web/runtime_type_to_string1_test.dart deleted file mode 100644 index 76848fb8f75..00000000000 --- a/tests/web/runtime_type_to_string1_test.dart +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// dart2jsOptions=--strong --omit-implicit-checks --lax-runtime-type-to-string - -import 'package:expect/expect.dart'; - -class Class { - Class(); -} - -main() { - // Since the type argument of `Class` is only needed for - // `.runtimeType.toString()`, it is not reified, and the toString is therefore - // 'Class'. - String className = (Class).toString(); - className = className.substring(0, className.indexOf('<')); - String erasedName = '$className'; - Expect.equals(erasedName, new Class().runtimeType.toString()); - Expect.equals(erasedName, new Class().runtimeType.toString()); -} diff --git a/tests/web/this_phi_elimination_test.dart b/tests/web/this_phi_elimination_test.dart index 80f7bb078c4..4ceb31b96f4 100644 --- a/tests/web/this_phi_elimination_test.dart +++ b/tests/web/this_phi_elimination_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// dart2jsOptions=-O1 + import "package:expect/expect.dart"; class A { diff --git a/tests/web/web.status b/tests/web/web.status index 10149180960..0724a8e2592 100644 --- a/tests/web/web.status +++ b/tests/web/web.status @@ -3,8 +3,7 @@ # BSD-style license that can be found in the LICENSE file. [ $compiler != dart2js ] -internal/array_flags_errors_test: SkipByDesign # test specific for the dart2js runtime -internal/deferred_url_test: SkipByDesign # test specific for the dart2js runtime +dart2js/*: SkipByDesign # tests specific to dart2js [ $compiler == dart2wasm ] (?!wasm)*: SkipByDesign @@ -19,6 +18,9 @@ native/*: Skip # dart2js tests for native keyword wasm_js_shared/weak_reference_polyfill_test: SkipByDesign # Test specific for the dart2js/dart2wasm runtime [ $runtime == d8 ] +dart2js/deferred_with_cross_origin_test: SkipByDesign # Requires dom +dart2js/deferred_with_csp_nonce2_test: SkipByDesign # Requires dom +dart2js/deferred_with_csp_nonce_test: SkipByDesign # Requires dom internal/html_mocks_with_static_interop_test: SkipByDesign # Browser test internal/object_members_test: SkipByDesign # Browser test @@ -41,21 +43,27 @@ deferred_split_test: Slow, Pass # Issue 25940 consistent_index_error_string_test: Slow, Pass # Issue 25940 [ $compiler == dart2js && $csp ] -deferred_fail_and_retry_test: SkipByDesign # Uses eval to simulate failed loading. +dart2js/deferred_fail_and_retry_test: SkipByDesign # Uses eval to simulate failed loading. +internal/40296_test: SkipByDesign # Uses eval +internal/deferred/deferred_custom_loader: SkipByDesign # Uses eval +internal/deferred/load_in_correct_order_test: SkipByDesign # Uses eval +internal/deferred/load_multiple_in_correct_order_test: SkipByDesign # Uses eval +internal/deferred/load_with_priority_test: SkipByDesign # Uses eval internal/object_members_test: SkipByDesign # Uses eval for interop +internal/rti/js_interop_subtype_test: SkipByDesign # Uses eval js_interop_generic_cast_test: SkipByDesign # Issue 42085. CSP policy disallows injected JS code js_interop_non_null_asserts_disabled_test: SkipByDesign # Issue 42085. CSP policy disallows injected JS code js_interop_non_null_asserts_enabled_test: SkipByDesign # Issue 42085. CSP policy disallows injected JS code +js_interop_optional_arg_test: SkipByDesign # Uses eval +js_interop_test: SkipByDesign # Uses eval +regress/issue/40152a_test: SkipByDesign # Uses eval regress/issue/49129_test: SkipByDesign # Uses eval for interop [ $compiler == dart2js && !$host_asserts ] deferred/many_parts/many_parts_test: Slow, Pass # Large stress test by design -[ $compiler == dart2js && $minified ] -code_motion_exception_test: Skip # Requires unminified operator names. - [ $compiler == dart2js && ($runtime == ff || $runtime == jsshell || $runtime == safari) ] -code_motion_exception_test: Skip # Required V8 specific format of JavaScript errors. +dart2js/code_motion_exception_test: Skip # Required V8 specific format of JavaScript errors. [ $compiler == dart2wasm && $runtime != d8 ] wasm/source_map_simple_optimized_test: SkipByDesign # Reads source map file using d8's readbuffer