From c438f8b3f47cc6b38145cc46e07f2906d8022944 Mon Sep 17 00:00:00 2001 From: Sigmund Cherem Date: Tue, 13 Mar 2018 19:25:59 +0000 Subject: [PATCH] Dart2js defaults to the new common front-end Change-Id: Id0f69d258b010a746b56e259335185bcca7dafec Reviewed-on: https://dart-review.googlesource.com/45143 Commit-Queue: Sigmund Cherem Reviewed-by: Johnni Winther --- CHANGELOG.md | 31 +++++++ pkg/compiler/lib/src/commandline_options.dart | 4 +- pkg/compiler/lib/src/dart2js.dart | 14 ++-- pkg/compiler/lib/src/options.dart | 13 ++- tests/compiler/dart2js/all_native_test.dart | 4 +- .../codegen/expect_annotations2_test.dart | 2 +- .../codegen/expect_annotations_test.dart | 2 +- .../codegen/gvn_dynamic_field_get_test.dart | 2 +- .../dart2js/codegen/is_function_test.dart | 4 +- .../dart2js/codegen/number_output_test.dart | 4 +- .../codegen/trust_type_annotations2_test.dart | 4 +- .../codegen/trust_type_annotations_test.dart | 4 +- .../codegen/unused_empty_map_test.dart | 2 +- .../dart2js/codegen/use_checks_test.dart | 2 +- .../dart2js/codegen/use_strict_test.dart | 2 +- .../dart2js/codegen/value_range3_test.dart | 2 +- tests/compiler/dart2js/compiler_helper.dart | 4 +- tests/compiler/dart2js/dart2js.status | 11 +-- .../dart2js/deferred/closures_test.dart | 2 +- .../dart2js/deferred/custom_element_test.dart | 2 +- .../dont_inline_deferred_constants_test.dart | 2 +- .../dont_inline_deferred_globals_test.dart | 2 +- .../deferred/emit_type_checks_test.dart | 2 +- .../follow_constant_dependencies_test.dart | 2 +- ...follow_implicit_super_regression_test.dart | 2 +- .../deferred/inline_restrictions_test.dart | 26 +++--- .../load_graph_segmentation2_test.dart | 8 +- .../load_graph_segmentation_test.dart | 18 ++--- .../dart2js/deferred/not_in_main_test.dart | 25 ++---- .../deferred/unneeded_part_js_test.dart | 2 +- tests/compiler/dart2js/dill_loader_test.dart | 4 +- tests/compiler/dart2js/dump_info_test.dart | 4 +- .../async_compiler_input_provider_test.dart | 21 +++-- .../dart2js/end_to_end/command_line_test.dart | 25 ++++-- .../dart2js/end_to_end/exit_code_test.dart | 2 + .../dart2js/end_to_end/library_env_test.dart | 7 +- .../equivalence/id_equivalence_helper.dart | 8 +- .../dart2js/equivalence/show_helper.dart | 4 +- ...te_code_with_compile_time_errors_test.dart | 2 +- .../generic_methods/generic_method_test.dart | 1 - .../dart2js/generic_methods/world_test.dart | 3 +- tests/compiler/dart2js/in_user_code_test.dart | 33 +++++--- .../dart2js/inference/list_tracer_test.dart | 2 +- .../dart2js/inference/map_tracer_test.dart | 2 +- .../inference/type_combination_test.dart | 2 +- .../inference/type_mask_disjoint_test.dart | 2 +- .../dart2js/inference/type_mask_test.dart | 2 +- .../inlining/meta_annotations2_test.dart | 2 +- .../inlining/meta_annotations3_test.dart | 2 +- .../inlining/meta_annotations_test.dart | 2 +- .../compiler/dart2js/js/js_constant_test.dart | 2 +- .../dart2js/js/js_spec_optimization_test.dart | 2 +- .../dart2js/jsinterop/declaration_test.dart | 3 +- .../dart2js/kernel/closed_world2_test.dart | 6 +- .../kernel/closed_world_from_dill_test.dart | 6 +- .../dart2js/kernel/compiler_helper.dart | 10 ++- tests/compiler/dart2js/kernel/helper.dart | 2 +- tests/compiler/dart2js/kernel/mixin_test.dart | 5 +- .../dart2js/kernel/run_from_dill_test.dart | 2 +- tests/compiler/dart2js/memory_compiler.dart | 6 +- .../mirrors/array_tracing_mirror_test.dart | 7 +- .../mirrors/deferred_mirrors_test.dart | 4 +- .../dart2js/mirrors/import_mirrors_test.dart | 3 +- .../mirror_final_field_inferrer2_test.dart | 5 +- .../mirror_final_field_inferrer_test.dart | 5 +- .../mirror_private_name_inheritance_test.dart | 5 +- .../mirrors/mirror_tree_shaking_test.dart | 5 +- .../dart2js/mirrors/mirrors_used_test.dart | 3 +- .../dart2js/mirrors/preserve_uris_test.dart | 3 +- .../constant_expression_evaluate_test.dart | 5 +- .../model/constant_expression_test.dart | 81 ++++++++++--------- .../dart2js/no_such_method_enabled_test.dart | 2 +- .../old_frontend/analyze_all_test.dart | 2 +- .../analyze_dart2js_helpers_test.dart | 1 + .../dart2js/old_frontend/analyze_helper.dart | 1 + .../old_frontend/analyze_only_test.dart | 1 + .../dart2js/old_frontend/bad_loop_test.dart | 5 +- .../old_frontend/benign_error_test.dart | 5 +- .../dart2js/old_frontend/categories_test.dart | 3 +- .../check_elements_invariants_test.dart | 4 +- .../old_frontend/combinator_hint_test.dart | 2 +- .../old_frontend/diagnose_ambiguous_test.dart | 3 +- .../old_frontend/duplicate_library_test.dart | 2 +- .../old_frontend/error_token_test.dart | 4 +- .../old_frontend/frontend_checker.dart | 3 +- .../generic_method_type_usage_test.dart | 3 +- .../dart2js/old_frontend/import_test.dart | 14 +++- .../old_frontend/library_resolution_test.dart | 4 +- .../old_frontend/malformed_uri_test.dart | 5 +- .../dart2js/old_frontend/members_test.dart | 13 +-- .../old_frontend/message_kind_helper.dart | 7 +- .../old_frontend/message_span_test.dart | 2 +- .../method_type_variable_test.dart | 5 +- .../old_frontend/minimal_resolution_test.dart | 4 +- .../old_frontend/missing_file_test.dart | 4 +- .../dart2js/old_frontend/mock_compiler.dart | 1 + .../old_frontend/package_root_test.dart | 4 +- .../dart2js/old_frontend/related_types.dart | 6 +- .../old_frontend/related_types_test.dart | 2 +- .../old_frontend/semantic_visitor_test.dart | 2 +- .../dart2js/old_frontend/space_test.dart | 1 + .../old_frontend/warnings_checker.dart | 2 +- tests/compiler/dart2js/output_type_test.dart | 4 +- .../dart2js/rti/backend_type_helper_test.dart | 2 +- .../dart2js/rti/disable_rti_test.dart | 2 +- .../dart2js/rti/factory_call_test.dart | 3 +- .../dart2js/rti/instance_call_test.dart | 3 +- .../serialization/analysis_test_helper.dart | 2 +- .../compilation_test_helper.dart | 2 +- .../serialization/duplicate_library_test.dart | 2 +- .../serialization/equivalence_test.dart | 6 +- .../dart2js/serialization/helper.dart | 4 +- .../serialization/model_test_helper.dart | 5 +- .../serialization/resolved_ast_test.dart | 7 +- .../dart2js/show_package_warnings_test.dart | 7 +- .../sourcemaps/d2js_validity_test.dart | 8 +- .../deferred_d2js_validity_test.dart | 8 +- .../dart2js/sourcemaps/mapping_test.dart | 44 +++------- .../sourcemaps/multi_source_info_test.dart | 16 ++-- .../dart2js/sourcemaps/name_test.dart | 65 ++++++++------- .../sourcemaps/pub_build_validity_test.dart | 5 +- .../dart2js/sourcemaps/stacktrace_test.dart | 4 +- .../dart2js/sourcemaps/stepping_test.dart | 5 +- .../tools/source_mapping_tester.dart | 7 +- tests/compiler/dart2js/type_test_helper.dart | 5 +- .../compiler/dart2js/uri_retention_test.dart | 2 +- tests/compiler/dart2js/user_crash_test.dart | 2 +- .../dart2js/zero_termination_test.dart | 4 +- .../dart2js_extra/dart2js_extra.status | 8 +- tools/testing/dart/configuration.dart | 2 +- 130 files changed, 496 insertions(+), 359 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6326fa2a17..ea3f2d51fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,37 @@ * Changed return type of `encode` on `AsciiCodec` and `Latin1Codec`, and `convert` on `AsciiEncoder`, `Latin1Encoder`, to `Uint8List`. +### Tool Changes + +* dart2js + + * The dart2js compiler now uses the common front-end by default. This is a + step towards supporting Dart 2.0. At this time dart2js has no semantic + changes: the Dart 2.0 strong-mode semantics are not enabled, so dart2js + continues to support the Dart 1 type system. This change however lets us + start supporting new syntactic features of Dart 2.0, like optional + new/const. With this change you may notice: + + * small code differences (~1% code size): some code is generated slightly + different, this is expected because the internal representation of the + program has small differences between the old and new front end. + + * source-maps changes: with the new front-end, dart2js also is using a new + mechanism to generate source-map files. We don't expect big differences + here either, the new source-maps try to encode more data for locations + that are commonly used during debugging. + + * some missing errors: the CFE is not complete and may not report some + static errors that the old front-end did. This is temporary. If you run + the analyzer on all your project already, you may never notice those + missing error messages. + + * as announced earlier, this is the first version of dart2js that no longer + supports `dart:mirrors`. + + * this is the first version of dart2js that no longer supports + `--package-root`, which long ago was deprecated in favor of `--packages`. + ## 2.0.0 ### Language diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart index b44128c52de..261a3ef7cb9 100644 --- a/pkg/compiler/lib/src/commandline_options.dart +++ b/pkg/compiler/lib/src/commandline_options.dart @@ -35,9 +35,7 @@ class Flags { static const String generateCodeWithCompileTimeErrors = '--generate-code-with-compile-time-errors'; - /// Enable the unified front end, loading from .dill files, and compilation - /// using the kernel representation. - /// See [CompilerOptions.useKernel] for details. + /// TODO(sigmund): delete this flag. static const String useKernel = '--use-kernel'; /// Temporary flag to revert to the old front-end once the new common diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart index 27943d17f51..9c46934e8b6 100644 --- a/pkg/compiler/lib/src/dart2js.dart +++ b/pkg/compiler/lib/src/dart2js.dart @@ -139,7 +139,7 @@ Future compile(List argv, bool showWarnings; bool showHints; bool enableColors; - bool useKernel = false; + bool useKernel = true; Uri platformBinaries = computePlatformBinariesLocation(); // List of provided options that imply that output is expected. List optionsImplyCompilation = []; @@ -287,10 +287,8 @@ Future compile(List argv, passThrough('--categories=${categories.join(",")}'); } - void setUseKernel(String argument) { - useKernel = true; - // TODO(sigmund): reenable hints (Issue #32111) - showHints = false; + void setUseOldFrontend(String argument) { + useKernel = false; passThrough(argument); } @@ -347,8 +345,8 @@ Future compile(List argv, new OptionHandler( '--output-type=dart|--output-type=dart-multi|--output-type=js', setOutputType), - new OptionHandler(Flags.useKernel, setUseKernel), - new OptionHandler(Flags.useOldFrontend, ignoreOption), + new OptionHandler(Flags.useKernel, ignoreOption), + new OptionHandler(Flags.useOldFrontend, setUseOldFrontend), new OptionHandler(Flags.platformBinaries, setPlatformBinaries), new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), new OptionHandler(Flags.verbose, setVerbose), @@ -598,6 +596,8 @@ Future compile(List argv, Uri script = currentDirectory.resolve(arguments[0]); if (useKernel) { diagnosticHandler.autoReadFileUri = true; + // TODO(sigmund): reenable hints (Issue #32111) + diagnosticHandler.showHints = showHints = false; } CompilerOptions compilerOptions = new CompilerOptions.parse( entryPoint: script, diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart index e194cbd6fc8..ec4b54c41b3 100644 --- a/pkg/compiler/lib/src/options.dart +++ b/pkg/compiler/lib/src/options.dart @@ -336,7 +336,8 @@ class CompilerOptions implements DiagnosticOptions { outputUri: _extractUriOption(options, '--out='), platformConfigUri: _resolvePlatformConfigFromOptions(libraryRoot, options), - platformBinaries: platformBinaries, + platformBinaries: platformBinaries ?? + _extractUriOption(options, '--platform-binaries='), preserveComments: _hasOption(options, Flags.preserveComments), preserveUris: _hasOption(options, Flags.preserveUris), resolutionInputs: resolutionInputs, @@ -352,7 +353,7 @@ class CompilerOptions implements DiagnosticOptions { trustTypeAnnotations: _hasOption(options, Flags.trustTypeAnnotations), useContentSecurityPolicy: _hasOption(options, Flags.useContentSecurityPolicy), - useKernel: _hasOption(options, Flags.useKernel), + useKernel: !_hasOption(options, Flags.useOldFrontend), useFrequencyNamer: !_hasOption(options, Flags.noFrequencyBasedMinification), useMultiSourceInfo: _hasOption(options, Flags.useMultiSourceInfo), @@ -419,7 +420,7 @@ class CompilerOptions implements DiagnosticOptions { bool trustPrimitives: false, bool trustTypeAnnotations: false, bool useContentSecurityPolicy: false, - bool useKernel: false, + bool useKernel: true, bool useFrequencyNamer: true, bool useMultiSourceInfo: false, bool useNewSourceInfo: false, @@ -450,9 +451,7 @@ class CompilerOptions implements DiagnosticOptions { } } if (useKernel && platformBinaries == null) { - throw new ArgumentError( - "${Flags.useKernel} is only supported in combination " - "with ${Flags.platformBinaries}"); + throw new ArgumentError("Missing required ${Flags.platformBinaries}"); } return new CompilerOptions._(entryPoint, libraryRoot, packageRoot, packageConfig, packagesDiscoveryProvider, environment, @@ -559,7 +558,7 @@ class CompilerOptions implements DiagnosticOptions { this.trustPrimitives: false, this.trustTypeAnnotations: false, this.useContentSecurityPolicy: false, - this.useKernel: false, + this.useKernel: true, this.useFrequencyNamer: false, this.useMultiSourceInfo: false, this.useNewSourceInfo: false, diff --git a/tests/compiler/dart2js/all_native_test.dart b/tests/compiler/dart2js/all_native_test.dart index 3d1d5fd9c1d..e1f236cf4c7 100644 --- a/tests/compiler/dart2js/all_native_test.dart +++ b/tests/compiler/dart2js/all_native_test.dart @@ -10,9 +10,9 @@ import 'memory_compiler.dart'; main() { asyncTest(() async { print('--test from ast---------------------------------------------------'); - await test([]); + await test([Flags.useOldFrontend]); print('--test from kernel------------------------------------------------'); - await test([Flags.useKernel]); + await test([]); }); } diff --git a/tests/compiler/dart2js/codegen/expect_annotations2_test.dart b/tests/compiler/dart2js/codegen/expect_annotations2_test.dart index 3dea0f394be..81d8a0ad83f 100644 --- a/tests/compiler/dart2js/codegen/expect_annotations2_test.dart +++ b/tests/compiler/dart2js/codegen/expect_annotations2_test.dart @@ -42,7 +42,7 @@ void main() { await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); // Simply check that the constants of the small functions are still in the // output, and that we don't see the result of constant folding. String jsOutput = collector.getOutput('', OutputType.js); diff --git a/tests/compiler/dart2js/codegen/expect_annotations_test.dart b/tests/compiler/dart2js/codegen/expect_annotations_test.dart index d4cacfaf0d4..89619b6d1e0 100644 --- a/tests/compiler/dart2js/codegen/expect_annotations_test.dart +++ b/tests/compiler/dart2js/codegen/expect_annotations_test.dart @@ -60,7 +60,7 @@ main() { runTest({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation'); diff --git a/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart b/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart index 7d03a190bb3..f9381f8d7e3 100644 --- a/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart +++ b/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart @@ -34,7 +34,7 @@ main() { CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': TEST}, outputProvider: outputCollector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; ClosedWorldBase closedWorld = compiler.resolutionWorldBuilder.closedWorldForTesting; diff --git a/tests/compiler/dart2js/codegen/is_function_test.dart b/tests/compiler/dart2js/codegen/is_function_test.dart index d594a906c42..9f1676d7da4 100644 --- a/tests/compiler/dart2js/codegen/is_function_test.dart +++ b/tests/compiler/dart2js/codegen/is_function_test.dart @@ -20,8 +20,8 @@ main(arg) {} main() { runTest({bool useKernel}) async { List options = [Flags.enableCheckedMode]; - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': SOURCE}, options: options); diff --git a/tests/compiler/dart2js/codegen/number_output_test.dart b/tests/compiler/dart2js/codegen/number_output_test.dart index e755932e497..07e7126d6d0 100644 --- a/tests/compiler/dart2js/codegen/number_output_test.dart +++ b/tests/compiler/dart2js/codegen/number_output_test.dart @@ -23,8 +23,8 @@ const MEMORY_SOURCE_FILES = const { Future test({bool useKernel, bool minify}) async { OutputCollector collector = new OutputCollector(); List options = []; - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } if (minify) { options.add(Flags.minify); diff --git a/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart b/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart index 40e765133ba..ba65adec881 100644 --- a/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart +++ b/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart @@ -27,8 +27,8 @@ main (x, y) { main() { runTest({bool useKernel}) async { var options = [Flags.trustTypeAnnotations]; - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } var result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, options: options); diff --git a/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart b/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart index 1f099096379..ff423acba1e 100644 --- a/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart +++ b/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart @@ -52,8 +52,8 @@ main () { void main() { runTest({bool useKernel}) async { var options = [Flags.trustTypeAnnotations]; - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } var result = await runCompiler( memorySourceFiles: {'main.dart': TEST}, options: options); diff --git a/tests/compiler/dart2js/codegen/unused_empty_map_test.dart b/tests/compiler/dart2js/codegen/unused_empty_map_test.dart index 0b52c0c19c9..db577be5d11 100644 --- a/tests/compiler/dart2js/codegen/unused_empty_map_test.dart +++ b/tests/compiler/dart2js/codegen/unused_empty_map_test.dart @@ -27,7 +27,7 @@ main() { await runCompiler( memorySourceFiles: TEST_SOURCE, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); String generated = collector.getOutput('', OutputType.js); Expect.isFalse(generated.contains(HASHMAP_EMPTY_CONSTRUCTOR)); } diff --git a/tests/compiler/dart2js/codegen/use_checks_test.dart b/tests/compiler/dart2js/codegen/use_checks_test.dart index 7647e8f750d..283e81ca190 100644 --- a/tests/compiler/dart2js/codegen/use_checks_test.dart +++ b/tests/compiler/dart2js/codegen/use_checks_test.dart @@ -26,7 +26,7 @@ main (x, y) { main() { runTest({bool useKernel}) async { var options = [Flags.enableCheckedMode]; - if (useKernel) options.add(Flags.useKernel); + if (!useKernel) options.add(Flags.useOldFrontend); var result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, options: options); var compiler = result.compiler; diff --git a/tests/compiler/dart2js/codegen/use_strict_test.dart b/tests/compiler/dart2js/codegen/use_strict_test.dart index b11d2544ad0..fe3cd70a1c1 100644 --- a/tests/compiler/dart2js/codegen/use_strict_test.dart +++ b/tests/compiler/dart2js/codegen/use_strict_test.dart @@ -53,7 +53,7 @@ main() { await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); String jsOutput = collector.getOutput('', OutputType.js); // Skip comments. diff --git a/tests/compiler/dart2js/codegen/value_range3_test.dart b/tests/compiler/dart2js/codegen/value_range3_test.dart index 9296662abba..899f5f33b07 100644 --- a/tests/compiler/dart2js/codegen/value_range3_test.dart +++ b/tests/compiler/dart2js/codegen/value_range3_test.dart @@ -27,7 +27,7 @@ main() { runTest({bool useKernel}) async { var result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); var compiler = result.compiler; var element = compiler.backendClosedWorldForTesting.elementEnvironment.mainFunction; diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart index 05f79fd4ff4..dfd772114e9 100644 --- a/tests/compiler/dart2js/compiler_helper.dart +++ b/tests/compiler/dart2js/compiler_helper.dart @@ -75,8 +75,8 @@ Future compile(String code, if (trustJSInteropTypeAnnotations) { options.add(Flags.trustJSInteropTypeAnnotations); } - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } if (disableInlining) { options.add(Flags.disableInlining); diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status index 39af62abc44..6fd332e9d9e 100644 --- a/tests/compiler/dart2js/dart2js.status +++ b/tests/compiler/dart2js/dart2js.status @@ -1,7 +1,6 @@ # Copyright (c) 2012, 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. - analyze_dart_test: Slow, Pass analyze_test: Slow, Pass async_await_syntax_test: Pass # DON'T CHANGE THIS LINE -- Don't mark these tests as failing. Instead, fix the errors/warnings that they report or update the whitelist in the test-files to temporarily allow digression. @@ -12,6 +11,8 @@ codegen/logical_expression_test: Fail # Issue 17027 codegen/simple_function_subtype_test: Fail # simple_function_subtype_test is temporarily(?) disabled due to new method for building function type tests. deferred_loading/deferred_loading_test: Slow, Pass equivalence/id_equivalence_test: Pass, Slow +generate_code_with_compile_time_errors_test: RuntimeError # not supported yet with the new FE. +in_user_code_test: RuntimeError # analyze-only with CFE is not complete (Issues 32512, 32513) inference/inference0_test: Slow, Pass inference/inference1_test: Slow, Pass inference/simple_inferrer_const_closure2_test: Fail # Issue 16507 @@ -30,13 +31,11 @@ mirrors/library_imports_prefixed_test: Fail mirrors/library_imports_shown_test: Fail no_such_method_enabled_test: Pass, Slow old_frontend/check_elements_invariants_test: Skip # Times out even with Slow marker. Slow due to inlining in the CPS backend -old_frontend/check_elements_invariants_test: Skip # Times out even with Slow marker. Slow due to inlining in the CPS backend -old_frontend/compile_with_empty_libraries_test: Fail # Issue 24223 old_frontend/compile_with_empty_libraries_test: Fail # Issue 24223 old_frontend/patch_test/bug: RuntimeError # Issue 21132 old_frontend/resolver_test: RuntimeError # Test must be updated given new parser recovery packages/*: Skip # Skip packages folder -quarantined/http_test: Pass, Slow +quarantined/http_test: RuntimeError # not supported with CFE, consider deleting. rti/rti_emission_test: Pass, Slow rti/rti_need_test: Pass, Slow serialization/analysis1_test: Skip # Skip most serialization tests. These are very slow and are no longer a priority. @@ -59,6 +58,8 @@ serialization/model5_test: Skip # Skip most serialization tests. These are very serialization/model_1_test: Skip # Skip most serialization tests. These are very slow and are no longer a priority. serialization/native_data_test: Skip # Skip most serialization tests. These are very slow and are no longer a priority. serialization/reserialization_test: Slow, RuntimeError # Issue 32149 +show_package_warnings_test: RuntimeError # missing errors from the FE +sourcemaps/pub_build_validity_test: Pass, RuntimeError # Investigate: passes locally, but only fails in bots. sourcemaps/source_mapping_invokes_test: Pass, Slow sourcemaps/source_mapping_operators_test: Pass, Slow sourcemaps/source_mapping_test: Pass, Slow @@ -88,8 +89,8 @@ sourcemaps/source_map_pub_build_validity_test: Pass, Slow dart2js_batch2_test: Pass, RuntimeError # Issue 29021 [ $checked ] -codegen/value_range_test: Pass, Slow codegen/value_range_kernel_test: Pass, Slow +codegen/value_range_test: Pass, Slow end_to_end/exit_code_test: Pass, Slow jsinterop/declaration_test: Slow, Pass jsinterop/interop_anonymous_unreachable_test: Pass, Slow diff --git a/tests/compiler/dart2js/deferred/closures_test.dart b/tests/compiler/dart2js/deferred/closures_test.dart index 30279cc7ee7..9e97701f885 100644 --- a/tests/compiler/dart2js/deferred/closures_test.dart +++ b/tests/compiler/dart2js/deferred/closures_test.dart @@ -23,7 +23,7 @@ void main() { runTest({bool useKernel}) async { OutputCollector collector = new OutputCollector(); - var options = useKernel ? [Flags.useKernel] : []; + var options = useKernel ? [] : [Flags.useOldFrontend]; await runCompiler( memorySourceFiles: sources, outputProvider: collector, options: options); String mainOutput = collector.getOutput("", OutputType.js); diff --git a/tests/compiler/dart2js/deferred/custom_element_test.dart b/tests/compiler/dart2js/deferred/custom_element_test.dart index 385e3c15d90..b47edfa81ce 100644 --- a/tests/compiler/dart2js/deferred/custom_element_test.dart +++ b/tests/compiler/dart2js/deferred/custom_element_test.dart @@ -24,7 +24,7 @@ void main() { runTest({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; var closedWorld = compiler.backendClosedWorldForTesting; var outputUnitForEntity = compiler.backend.outputUnitData.outputUnitForEntity; diff --git a/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart b/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart index 97822e11d33..23d692fe7c9 100644 --- a/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart +++ b/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart @@ -19,7 +19,7 @@ void main() { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; var closedWorld = compiler.backendClosedWorldForTesting; var elementEnvironment = closedWorld.elementEnvironment; diff --git a/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart b/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart index af56ad90f04..558f5856b63 100644 --- a/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart +++ b/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart @@ -19,7 +19,7 @@ void main() { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; var closedWorld = compiler.backendClosedWorldForTesting; var elementEnvironment = closedWorld.elementEnvironment; diff --git a/tests/compiler/dart2js/deferred/emit_type_checks_test.dart b/tests/compiler/dart2js/deferred/emit_type_checks_test.dart index e1aedd5ba28..370fc309809 100644 --- a/tests/compiler/dart2js/deferred/emit_type_checks_test.dart +++ b/tests/compiler/dart2js/deferred/emit_type_checks_test.dart @@ -20,7 +20,7 @@ void main() { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; String mainOutput = collector.getOutput('', OutputType.js); String deferredOutput = collector.getOutput('out_1', OutputType.jsPart); diff --git a/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart b/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart index 1be380f0529..6944dff31b8 100644 --- a/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart +++ b/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart @@ -15,7 +15,7 @@ void main() { runTest({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; var outputUnitForConstant = compiler.backend.outputUnitData.outputUnitForConstant; diff --git a/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart b/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart index 93ca8bce6e6..b83812ebc52 100644 --- a/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart +++ b/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart @@ -13,7 +13,7 @@ void main() { runTest({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); dart2js.Compiler compiler = result.compiler; var closedWorld = compiler.backendClosedWorldForTesting; var elementEnvironment = closedWorld.elementEnvironment; diff --git a/tests/compiler/dart2js/deferred/inline_restrictions_test.dart b/tests/compiler/dart2js/deferred/inline_restrictions_test.dart index 12585caaf42..a296c65e003 100644 --- a/tests/compiler/dart2js/deferred/inline_restrictions_test.dart +++ b/tests/compiler/dart2js/deferred/inline_restrictions_test.dart @@ -17,20 +17,16 @@ void main() { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector); Compiler compiler = result.compiler; - - lookupLibrary(name) { - return compiler.libraryLoader.lookupLibrary(Uri.parse(name)); - } - + var env = compiler.backendClosedWorldForTesting.elementEnvironment; var outputUnitForEntity = compiler.backend.outputUnitData.outputUnitForEntity; - + lookupLibrary(name) => env.lookupLibrary(Uri.parse(name)); dynamic lib1 = lookupLibrary("memory:lib1.dart"); - var inlineMeAway = lib1.find("inlineMeAway"); + var inlineMeAway = env.lookupLibraryMember(lib1, "inlineMeAway"); var ou_lib1 = outputUnitForEntity(inlineMeAway); dynamic lib3 = lookupLibrary("memory:lib3.dart"); - var sameContextInline = lib3.find("sameContextInline"); + var sameContextInline = env.lookupLibraryMember(lib3, "sameContextInline"); var ou_lib3 = outputUnitForEntity(sameContextInline); // Test that we actually got different output units. @@ -42,23 +38,25 @@ void main() { String lib3Output = collector.getOutput("out_${ou_lib3.name}", OutputType.jsPart); - RegExp re1 = new RegExp(r"inlined as empty"); - RegExp re2 = new RegExp(r"inlined from main"); - RegExp re3 = new RegExp(r"inlined from lib1"); - RegExp re4 = new RegExp(r"inline same context"); - // Test that inlineMeAway was inlined and its argument thus dropped. - Expect.isFalse(re1.hasMatch(mainOutput)); + // + // TODO(sigmund): reenable, this commented test changed after porting + // deferred loading to the new common frontend. + // RegExp re1 = new RegExp(r"inlined as empty"); + // Expect.isFalse(re1.hasMatch(mainOutput)); // Test that inlineFromMain was inlined and thus the string moved to lib1. + RegExp re2 = new RegExp(r"inlined from main"); Expect.isFalse(re2.hasMatch(mainOutput)); Expect.isTrue(re2.hasMatch(lib1Output)); // Test that inlineFromLib1 was not inlined into main. + RegExp re3 = new RegExp(r"inlined from lib1"); Expect.isFalse(re3.hasMatch(mainOutput)); Expect.isTrue(re3.hasMatch(lib1Output)); // Test that inlineSameContext was inlined into lib1. + RegExp re4 = new RegExp(r"inline same context"); Expect.isFalse(re4.hasMatch(lib3Output)); Expect.isTrue(re4.hasMatch(lib1Output)); }); diff --git a/tests/compiler/dart2js/deferred/load_graph_segmentation2_test.dart b/tests/compiler/dart2js/deferred/load_graph_segmentation2_test.dart index 80432358222..c73eb2eb96c 100644 --- a/tests/compiler/dart2js/deferred/load_graph_segmentation2_test.dart +++ b/tests/compiler/dart2js/deferred/load_graph_segmentation2_test.dart @@ -18,11 +18,11 @@ void main() { Compiler compiler = result.compiler; var outputUnitForEntity = compiler.backend.outputUnitData.outputUnitForEntity; + var env = compiler.backendClosedWorldForTesting.elementEnvironment; var mainOutputUnit = compiler.backend.outputUnitData.mainOutputUnit; - dynamic lib = - compiler.libraryLoader.lookupLibrary(Uri.parse("memory:lib.dart")); - var f1 = lib.find("f1"); - var f2 = lib.find("f2"); + dynamic lib = env.lookupLibrary(Uri.parse("memory:lib.dart")); + var f1 = env.lookupLibraryMember(lib, "f1"); + var f2 = env.lookupLibraryMember(lib, "f2"); Expect.notEquals(mainOutputUnit, outputUnitForEntity(f1)); Expect.equals(mainOutputUnit, outputUnitForEntity(f2)); }); diff --git a/tests/compiler/dart2js/deferred/load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred/load_graph_segmentation_test.dart index 028be895099..8135ce00c50 100644 --- a/tests/compiler/dart2js/deferred/load_graph_segmentation_test.dart +++ b/tests/compiler/dart2js/deferred/load_graph_segmentation_test.dart @@ -18,11 +18,9 @@ void main() { await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); Compiler compiler = result.compiler; - lookupLibrary(name) { - return compiler.libraryLoader.lookupLibrary(Uri.parse(name)); - } - - var main = compiler.frontendStrategy.elementEnvironment.mainFunction; + var env = compiler.backendClosedWorldForTesting.elementEnvironment; + lookupLibrary(name) => env.lookupLibrary(Uri.parse(name)); + var main = env.mainFunction; Expect.isNotNull(main, "Could not find 'main'"); var outputUnitForEntity = @@ -33,14 +31,14 @@ void main() { var classes = backend.emitter.neededClasses; var inputElement = classes.where((e) => e.name == 'InputElement').single; dynamic lib1 = lookupLibrary("memory:lib1.dart"); - var foo1 = lib1.find("foo1"); + var foo1 = env.lookupLibraryMember(lib1, "foo1"); dynamic lib2 = lookupLibrary("memory:lib2.dart"); - var foo2 = lib2.find("foo2"); + var foo2 = env.lookupLibraryMember(lib2, "foo2"); dynamic lib3 = lookupLibrary("memory:lib3.dart"); - var foo3 = lib3.find("foo3"); + var foo3 = env.lookupLibraryMember(lib3, "foo3"); dynamic lib4 = lookupLibrary("memory:lib4.dart"); - var bar1 = lib4.find("bar1"); - var bar2 = lib4.find("bar2"); + var bar1 = env.lookupLibraryMember(lib4, "bar1"); + var bar2 = env.lookupLibraryMember(lib4, "bar2"); OutputUnit ou_lib1 = outputUnitForEntity(foo1); OutputUnit ou_lib2 = outputUnitForEntity(foo2); diff --git a/tests/compiler/dart2js/deferred/not_in_main_test.dart b/tests/compiler/dart2js/deferred/not_in_main_test.dart index b495e9aa05e..4a13b29f35e 100644 --- a/tests/compiler/dart2js/deferred/not_in_main_test.dart +++ b/tests/compiler/dart2js/deferred/not_in_main_test.dart @@ -20,19 +20,15 @@ void deferredTest1() { asyncTest(() async { CompilationResult result = await runCompiler(memorySourceFiles: TEST1); Compiler compiler = result.compiler; - - lookupLibrary(name) { - return compiler.libraryLoader.lookupLibrary(Uri.parse(name)); - } - var outputUnitForEntity = compiler.backend.outputUnitData.outputUnitForEntity; - var mainOutputUnit = compiler.backend.outputUnitData.mainOutputUnit; + var env = compiler.backendClosedWorldForTesting.elementEnvironment; + lookupLibrary(name) => env.lookupLibrary(Uri.parse(name)); dynamic lib1 = lookupLibrary("memory:lib1.dart"); dynamic lib2 = lookupLibrary("memory:lib2.dart"); - lib1.find("foo1"); - var foo2 = lib2.find("foo2"); + env.lookupLibraryMember(lib1, "foo1"); + var foo2 = env.lookupLibraryMember(lib2, "foo2"); Expect.notEquals(mainOutputUnit, outputUnitForEntity(foo2)); }); @@ -42,17 +38,14 @@ void deferredTest2() { asyncTest(() async { CompilationResult result = await runCompiler(memorySourceFiles: TEST2); Compiler compiler = result.compiler; - - lookupLibrary(name) { - return compiler.libraryLoader.lookupLibrary(Uri.parse(name)); - } - var outputUnitForEntity = compiler.backend.outputUnitData.outputUnitForEntity; var mainOutputUnit = compiler.backend.outputUnitData.mainOutputUnit; + var env = compiler.backendClosedWorldForTesting.elementEnvironment; + lookupLibrary(name) => env.lookupLibrary(Uri.parse(name)); dynamic shared = lookupLibrary("memory:shared.dart"); - var a = shared.find("A"); + var a = env.lookupLibraryMember(shared, "A"); Expect.equals(mainOutputUnit, outputUnitForEntity(a)); }); @@ -75,10 +68,8 @@ library lib1; import 'lib2.dart' deferred as lib2; -const def = const DeferredLibrary('lib2'); - void foo1() { - lib1.loadLibrary().then((_) => lib2.foo2()); + lib2.loadLibrary().then((_) => lib2.foo2()); } """, "lib2.dart": """ diff --git a/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart b/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart index 2ef6af69c93..2ad4c000a90 100644 --- a/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart +++ b/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart @@ -17,7 +17,7 @@ main() { memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: diagnostics, outputProvider: output, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isFalse(diagnostics.hasRegularMessages); Expect.isFalse(output.hasExtraOutput); Expect.isTrue(result.isSuccess); diff --git a/tests/compiler/dart2js/dill_loader_test.dart b/tests/compiler/dart2js/dill_loader_test.dart index 148dca363e9..56ac31800c9 100644 --- a/tests/compiler/dart2js/dill_loader_test.dart +++ b/tests/compiler/dart2js/dill_loader_test.dart @@ -5,7 +5,6 @@ import 'dart:async'; import 'memory_compiler.dart'; import 'package:async_helper/async_helper.dart'; -import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/common_elements.dart'; import 'package:compiler/src/diagnostics/spannable.dart' show Spannable; import 'package:compiler/src/elements/entities.dart' @@ -58,8 +57,7 @@ main() { entryPoint: entryPoint, memorySourceFiles: {'main.dill': kernelBinary}, diagnosticHandler: diagnostics, - outputProvider: output, - options: [Flags.useKernel]); + outputProvider: output); await compiler.setupSdk(); await compiler.libraryLoader.loadLibrary(entryPoint); diff --git a/tests/compiler/dart2js/dump_info_test.dart b/tests/compiler/dart2js/dump_info_test.dart index f6280196744..cf1399bf55c 100644 --- a/tests/compiler/dart2js/dump_info_test.dart +++ b/tests/compiler/dart2js/dump_info_test.dart @@ -99,8 +99,8 @@ typedef void JsonTaking(Map json); jsonTest(String program, JsonTaking testFn, {bool useKernel}) async { var options = ['--out=out.js', Flags.dumpInfo]; - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } var result = await runCompiler( memorySourceFiles: {'main.dart': program}, options: options); diff --git a/tests/compiler/dart2js/end_to_end/async_compiler_input_provider_test.dart b/tests/compiler/dart2js/end_to_end/async_compiler_input_provider_test.dart index ba08d5cfd9a..8349c816107 100644 --- a/tests/compiler/dart2js/end_to_end/async_compiler_input_provider_test.dart +++ b/tests/compiler/dart2js/end_to_end/async_compiler_input_provider_test.dart @@ -28,11 +28,15 @@ const SOURCES = const { """ }; -Future provideInput(Uri uri) { - var source = SOURCES[uri.path]; +Future provideInput(Uri uri) { + dynamic source = SOURCES[uri.path]; if (source == null) { // Not one of our source files, so assume it's a built-in. - source = new File(uri.toFilePath()).readAsStringSync(); + if (uri.path.endsWith('.dill')) { + source = new File(uri.toFilePath()).readAsBytesSync(); + } else { + source = new File(uri.toFilePath()).readAsStringSync(); + } } // Deliver the input asynchronously. @@ -45,9 +49,14 @@ main() { // Find the path to sdk/ in the repo relative to this script. Uri libraryRoot = Uri.base.resolve('sdk/'); Uri packageRoot = Uri.base.resolve('packages/'); - - asyncTest(() => compiler.compile(entrypoint, libraryRoot, packageRoot, - provideInput, handleDiagnostic, []).then((code) { + var platformDir = Uri.parse(Platform.resolvedExecutable).resolve('.'); + asyncTest(() => compiler.compile( + entrypoint, + libraryRoot, + packageRoot, + provideInput, + handleDiagnostic, + ['--platform-binaries=${platformDir}']).then((code) { Expect.isNotNull(code); })); } diff --git a/tests/compiler/dart2js/end_to_end/command_line_test.dart b/tests/compiler/dart2js/end_to_end/command_line_test.dart index a45172b72e1..88a76504556 100644 --- a/tests/compiler/dart2js/end_to_end/command_line_test.dart +++ b/tests/compiler/dart2js/end_to_end/command_line_test.dart @@ -19,18 +19,29 @@ main() { asyncTest(() async { await test([], exitCode: 1); await test(['foo.dart']); - await test([Flags.useKernel], exitCode: 1); - await test([Flags.useKernel, 'foo.dart']); - await test([Flags.resolveOnly, 'foo.dart'], + await test([Flags.useOldFrontend], exitCode: 1); + await test([Flags.useOldFrontend, 'foo.dart']); + await test([Flags.useOldFrontend, Flags.resolveOnly, 'foo.dart'], resolveOnly: true, resolutionOutput: Uri.base.resolve('out.data')); - await test(['--resolution-input=bar.dart', 'foo.dart'], + await test( + [Flags.useOldFrontend, '--resolution-input=bar.dart', 'foo.dart'], resolutionInputs: [Uri.base.resolve('bar.dart')]); - await test([Flags.resolveOnly, '--resolution-input=bar.dart', 'foo.dart'], + await test( + [ + Flags.useOldFrontend, + Flags.resolveOnly, + '--resolution-input=bar.dart', + 'foo.dart' + ], resolveOnly: true, resolutionOutput: Uri.base.resolve('out.data'), resolutionInputs: [Uri.base.resolve('bar.dart')]); - await test([Flags.resolveOnly, '--resolution-input=out.data', 'foo.dart'], - exitCode: 1); + await test([ + Flags.useOldFrontend, + Flags.resolveOnly, + '--resolution-input=out.data', + 'foo.dart' + ], exitCode: 1); }); } diff --git a/tests/compiler/dart2js/end_to_end/exit_code_test.dart b/tests/compiler/dart2js/end_to_end/exit_code_test.dart index cd701545ace..a6549af666e 100644 --- a/tests/compiler/dart2js/end_to_end/exit_code_test.dart +++ b/tests/compiler/dart2js/end_to_end/exit_code_test.dart @@ -241,6 +241,8 @@ Future testExitCode( entry.compileFunc = compile; List args = new List.from(options) + // TODO(sigmund): convert to support the new CFE + ..add("--use-old-frontend") ..add("--library-root=${Uri.base.resolve('sdk/')}") ..add("tests/compiler/dart2js/end_to_end/data/exit_code_helper.dart"); Future result = entry.internalMain(args); diff --git a/tests/compiler/dart2js/end_to_end/library_env_test.dart b/tests/compiler/dart2js/end_to_end/library_env_test.dart index f6496d27abc..1fcdb15f54d 100644 --- a/tests/compiler/dart2js/end_to_end/library_env_test.dart +++ b/tests/compiler/dart2js/end_to_end/library_env_test.dart @@ -6,6 +6,7 @@ /// environment variable set. import 'dart:async'; +import 'dart:io'; import '../memory_source_file_helper.dart'; @@ -59,6 +60,8 @@ class DummyCompilerInput implements CompilerInput { return new Binary(uri, clientPlatform.codeUnits); } else if (uri.toString().endsWith("dart_server.platform")) { return new Binary(uri, serverPlatform.codeUnits); + } else if (uri.path.endsWith(".dill")) { + return new Binary(uri, new File.fromUri(uri).readAsBytesSync()); } else { throw "should not be needed $uri"; } @@ -73,6 +76,8 @@ class DummyCompilerDiagnostics implements CompilerDiagnostics { } } +final platformDir = Uri.parse(Platform.resolvedExecutable).resolve('.'); + class CustomCompiler extends CompilerImpl { CustomCompiler(options, environment) : super( @@ -81,7 +86,7 @@ class CustomCompiler extends CompilerImpl { const DummyCompilerDiagnostics(), new CompilerOptions.parse( libraryRoot: Uri.base.resolve("sdk/"), - options: options, + options: ['--platform-binaries=$platformDir']..addAll(options), environment: environment)); } diff --git a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart index 253b3da589f..09b47fa78ea 100644 --- a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart +++ b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart @@ -519,7 +519,7 @@ Future checkTests(Directory dataDir, ComputeMemberDataFunction computeFromAst, CompiledData compiledData1 = await computeData( entryPoint, memorySourceFiles, computeFromAst, computeClassData: computeClassDataFromAst, - options: testOptions, + options: [Flags.useOldFrontend]..addAll(testOptions), verbose: verbose, forUserLibrariesOnly: forUserLibrariesOnly, globalIds: annotations.globalData.keys); @@ -536,7 +536,7 @@ Future checkTests(Directory dataDir, ComputeMemberDataFunction computeFromAst, CompiledData compiledData2 = await computeData( entryPoint, memorySourceFiles, computeFromKernel, computeClassData: computeClassDataFromKernel, - options: [Flags.useKernel]..addAll(testOptions), + options: testOptions, verbose: verbose, forUserLibrariesOnly: forUserLibrariesOnly, globalIds: annotations.globalData.keys); @@ -762,7 +762,7 @@ Future compareData( print('--from ast----------------------------------------------------------'); CompiledData data1 = await computeData( entryPoint, memorySourceFiles, computeAstData, - options: options, + options: [Flags.useOldFrontend]..addAll(options), forUserLibrariesOnly: forUserLibrariesOnly, skipUnprocessedMembers: skipUnprocessedMembers, skipFailedCompilations: skipFailedCompilations); @@ -770,7 +770,7 @@ Future compareData( print('--from kernel-------------------------------------------------------'); CompiledData data2 = await computeData( entryPoint, memorySourceFiles, computeIrData, - options: [Flags.useKernel]..addAll(options), + options: options, forUserLibrariesOnly: forUserLibrariesOnly, skipUnprocessedMembers: skipUnprocessedMembers, skipFailedCompilations: skipFailedCompilations); diff --git a/tests/compiler/dart2js/equivalence/show_helper.dart b/tests/compiler/dart2js/equivalence/show_helper.dart index 6a60e11d639..9bdae9a79fe 100644 --- a/tests/compiler/dart2js/equivalence/show_helper.dart +++ b/tests/compiler/dart2js/equivalence/show_helper.dart @@ -47,8 +47,8 @@ show(ArgResults argResults, ComputeMemberDataFunction computeAstData, } options = new List.from(options); - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } if (strongMode) { options.add(Flags.strongMode); diff --git a/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart b/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart index 8654db504dd..321b440301c 100644 --- a/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart +++ b/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart @@ -17,7 +17,7 @@ import 'output_collector.dart'; const MEMORY_SOURCE_FILES = const { 'main.dart': ''' foo() { - const list = []; + const [ new List() ]; } main() { diff --git a/tests/compiler/dart2js/generic_methods/generic_method_test.dart b/tests/compiler/dart2js/generic_methods/generic_method_test.dart index 4138e440a25..1574ab99de2 100644 --- a/tests/compiler/dart2js/generic_methods/generic_method_test.dart +++ b/tests/compiler/dart2js/generic_methods/generic_method_test.dart @@ -177,7 +177,6 @@ main(List args) { Compiler compiler = await runWithD8(memorySourceFiles: { 'main.dart': SOURCE }, options: [ - Flags.useKernel, Flags.strongMode, Flags.disableRtiOptimization, ], expectedOutput: OUTPUT, printJs: args.contains('-v')); diff --git a/tests/compiler/dart2js/generic_methods/world_test.dart b/tests/compiler/dart2js/generic_methods/world_test.dart index 37b224486dc..4dbea81b424 100644 --- a/tests/compiler/dart2js/generic_methods/world_test.dart +++ b/tests/compiler/dart2js/generic_methods/world_test.dart @@ -86,8 +86,7 @@ main(args) { main() { asyncTest(() async { CompilationResult result = await runCompiler( - memorySourceFiles: {'main.dart': code}, - options: [Flags.useKernel, Flags.strongMode]); + memorySourceFiles: {'main.dart': code}, options: [Flags.strongMode]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; CodegenWorldBuilder worldBuilder = compiler.codegenWorldBuilder; diff --git a/tests/compiler/dart2js/in_user_code_test.dart b/tests/compiler/dart2js/in_user_code_test.dart index 1f926c64469..bc75652987d 100644 --- a/tests/compiler/dart2js/in_user_code_test.dart +++ b/tests/compiler/dart2js/in_user_code_test.dart @@ -38,14 +38,19 @@ library sub.baz; 'pkg/sup/boz.dart': """ library sup.boz; """, + '.packages': """ +sub:pkg/sub/ +sup:pkg/sup/ +""" }; Future test(List entryPoints, Map expectedResults) async { + print("Test: $entryPoints"); CompilationResult result = await runCompiler( entryPoints: entryPoints, memorySourceFiles: SOURCE, options: [Flags.analyzeOnly, Flags.analyzeAll], - packageRoot: Uri.parse('memory:pkg/')); + packageConfig: Uri.parse('memory:.packages')); Compiler compiler = result.compiler; expectedResults.forEach((String uri, bool expectedResult) { dynamic element = compiler.libraryLoader.lookupLibrary(Uri.parse(uri)); @@ -77,8 +82,10 @@ Future runTests() async { 'dart:core': false, 'dart:async': false }); - await test( - [Uri.parse('dart:async')], {'dart:core': true, 'dart:async': true}); + // TODO(sigmund): compiler with CFE doesn't work when given sdk libraries as + // entrypoints (Issue XYZ). + //await test( + // [Uri.parse('dart:async')], {'dart:core': true, 'dart:async': true}); await test([ Uri.parse('package:sub/bar.dart') ], { @@ -96,14 +103,14 @@ Future runTests() async { 'package:sup/boz.dart': true, 'dart:core': false }); - await test([ - Uri.parse('dart:async'), - Uri.parse('package:sub/bar.dart') - ], { - 'package:sub/bar.dart': true, - 'package:sub/baz.dart': true, - 'package:sup/boz.dart': false, - 'dart:core': true, - 'dart:async': true - }); + //await test([ + // Uri.parse('dart:async'), + // Uri.parse('package:sub/bar.dart') + //], { + // 'package:sub/bar.dart': true, + // 'package:sub/baz.dart': true, + // 'package:sup/boz.dart': false, + // 'dart:core': true, + // 'dart:async': true + //}); } diff --git a/tests/compiler/dart2js/inference/list_tracer_test.dart b/tests/compiler/dart2js/inference/list_tracer_test.dart index 613f8a36746..6182436b83b 100644 --- a/tests/compiler/dart2js/inference/list_tracer_test.dart +++ b/tests/compiler/dart2js/inference/list_tracer_test.dart @@ -213,7 +213,7 @@ doTest(String allocation, {bool nullify, bool useKernel}) async { String source = generateTest(allocation); var result = await runCompiler( memorySourceFiles: {'main.dart': source}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); var compiler = result.compiler; var typesInferrer = compiler.globalInference.typesInferrerInternal; diff --git a/tests/compiler/dart2js/inference/map_tracer_test.dart b/tests/compiler/dart2js/inference/map_tracer_test.dart index 0c1e02b9a97..a2be02a5106 100644 --- a/tests/compiler/dart2js/inference/map_tracer_test.dart +++ b/tests/compiler/dart2js/inference/map_tracer_test.dart @@ -234,7 +234,7 @@ doTest(String allocation, String source = generateTest(allocation); var result = await runCompiler( memorySourceFiles: {'main.dart': source}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; TypeMask keyType, valueType; diff --git a/tests/compiler/dart2js/inference/type_combination_test.dart b/tests/compiler/dart2js/inference/type_combination_test.dart index c79b188b5d1..8a056643bf1 100644 --- a/tests/compiler/dart2js/inference/type_combination_test.dart +++ b/tests/compiler/dart2js/inference/type_combination_test.dart @@ -761,7 +761,7 @@ runTests({bool useKernel}) async { } ''' }, - options: useKernel ? [Flags.useKernel] : [], + options: useKernel ? [] : [Flags.useOldFrontend], beforeRun: (compiler) => compiler.stopAfterTypeInference = true); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; diff --git a/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart b/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart index f67dd0ab2d8..f9d8e70f4b5 100644 --- a/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart +++ b/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart @@ -43,7 +43,7 @@ main() { runTests({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': CODE}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; ClosedWorld world = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/inference/type_mask_test.dart b/tests/compiler/dart2js/inference/type_mask_test.dart index fc668d09a7d..dd77a78d10e 100644 --- a/tests/compiler/dart2js/inference/type_mask_test.dart +++ b/tests/compiler/dart2js/inference/type_mask_test.dart @@ -26,7 +26,7 @@ main() { runTests({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': CODE}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/inlining/meta_annotations2_test.dart b/tests/compiler/dart2js/inlining/meta_annotations2_test.dart index 2797238608e..64769bc04ba 100644 --- a/tests/compiler/dart2js/inlining/meta_annotations2_test.dart +++ b/tests/compiler/dart2js/inlining/meta_annotations2_test.dart @@ -44,7 +44,7 @@ void main() { await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); // Simply check that the constants of the small functions are still in the // output, and that we don't see the result of constant folding. String jsOutput = collector.getOutput('', OutputType.js); diff --git a/tests/compiler/dart2js/inlining/meta_annotations3_test.dart b/tests/compiler/dart2js/inlining/meta_annotations3_test.dart index 37d1b76ba74..47109f3d163 100644 --- a/tests/compiler/dart2js/inlining/meta_annotations3_test.dart +++ b/tests/compiler/dart2js/inlining/meta_annotations3_test.dart @@ -56,7 +56,7 @@ void main() { await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); String jsOutput = collector.getOutput('', OutputType.js); void has(String text) { diff --git a/tests/compiler/dart2js/inlining/meta_annotations_test.dart b/tests/compiler/dart2js/inlining/meta_annotations_test.dart index 2eaee34ac8a..256c28c2cbc 100644 --- a/tests/compiler/dart2js/inlining/meta_annotations_test.dart +++ b/tests/compiler/dart2js/inlining/meta_annotations_test.dart @@ -37,7 +37,7 @@ main() { runTests({bool useKernel}) async { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.resolutionWorldBuilder.closedWorldForTesting; diff --git a/tests/compiler/dart2js/js/js_constant_test.dart b/tests/compiler/dart2js/js/js_constant_test.dart index b9754d303de..22eeedff65c 100644 --- a/tests/compiler/dart2js/js/js_constant_test.dart +++ b/tests/compiler/dart2js/js/js_constant_test.dart @@ -28,7 +28,7 @@ main() { var result = await runCompiler( entryPoint: entryPoint, memorySourceFiles: {main: test}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); var compiler = result.compiler; var closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/js/js_spec_optimization_test.dart b/tests/compiler/dart2js/js/js_spec_optimization_test.dart index 9cd6a885fbe..36085193f86 100644 --- a/tests/compiler/dart2js/js/js_spec_optimization_test.dart +++ b/tests/compiler/dart2js/js/js_spec_optimization_test.dart @@ -95,7 +95,7 @@ main() { var result = await runCompiler( entryPoint: entryPoint, memorySourceFiles: {main: test}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); var compiler = result.compiler; var closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/jsinterop/declaration_test.dart b/tests/compiler/dart2js/jsinterop/declaration_test.dart index 45e2e05b535..31ad8d36f2e 100644 --- a/tests/compiler/dart2js/jsinterop/declaration_test.dart +++ b/tests/compiler/dart2js/jsinterop/declaration_test.dart @@ -449,9 +449,10 @@ runTestInternal(Test test, {bool useKernel}) async { DiagnosticCollector collector = new DiagnosticCollector(); List options = []; if (useKernel) { - options.add(Flags.useKernel); // TODO(redemption): Enable inlining. options.add(Flags.disableInlining); + } else { + options.add(Flags.useOldFrontend); } print('--useKernel=${useKernel}--------------------------------------------'); await runCompiler( diff --git a/tests/compiler/dart2js/kernel/closed_world2_test.dart b/tests/compiler/dart2js/kernel/closed_world2_test.dart index b6828d03be0..fe9b70d4fb0 100644 --- a/tests/compiler/dart2js/kernel/closed_world2_test.dart +++ b/tests/compiler/dart2js/kernel/closed_world2_test.dart @@ -198,7 +198,11 @@ Future mainInternal(List args, entryPoint: entryPoint, memorySourceFiles: memorySourceFiles, diagnosticHandler: collector, - options: [Flags.analyzeOnly, Flags.enableAssertMessage], + options: [ + Flags.useOldFrontend, + Flags.analyzeOnly, + Flags.enableAssertMessage + ], beforeRun: (compiler) { compiler.impactCacheDeleter.retainCachesForTesting = true; }); diff --git a/tests/compiler/dart2js/kernel/closed_world_from_dill_test.dart b/tests/compiler/dart2js/kernel/closed_world_from_dill_test.dart index 4f65d62cd4a..5dc6689ed8e 100644 --- a/tests/compiler/dart2js/kernel/closed_world_from_dill_test.dart +++ b/tests/compiler/dart2js/kernel/closed_world_from_dill_test.dart @@ -115,7 +115,11 @@ Future mainInternal(List args, CompilationResult result = await runCompiler( entryPoint: entryPoint, diagnosticHandler: collector, - options: [Flags.analyzeOnly, Flags.enableAssertMessage], + options: [ + Flags.useOldFrontend, + Flags.analyzeOnly, + Flags.enableAssertMessage + ], beforeRun: (compiler) { compiler.impactCacheDeleter.retainCachesForTesting = true; }); diff --git a/tests/compiler/dart2js/kernel/compiler_helper.dart b/tests/compiler/dart2js/kernel/compiler_helper.dart index 903758a4b2c..a11907e1de0 100644 --- a/tests/compiler/dart2js/kernel/compiler_helper.dart +++ b/tests/compiler/dart2js/kernel/compiler_helper.dart @@ -37,7 +37,11 @@ Future> analyzeOnly( CompilationResult result1 = await runCompiler( entryPoint: entryPoint, memorySourceFiles: memorySourceFiles, - options: [Flags.analyzeAll, Flags.enableAssertMessage], + options: [ + Flags.useOldFrontend, + Flags.analyzeAll, + Flags.enableAssertMessage + ], beforeRun: (compiler) { compiler.impactCacheDeleter.retainCachesForTesting = true; }); @@ -49,7 +53,7 @@ Future> analyzeOnly( CompilationResult result2 = await runCompiler( entryPoint: entryPoint, memorySourceFiles: memorySourceFiles, - options: [Flags.analyzeOnly, Flags.enableAssertMessage, Flags.useKernel], + options: [Flags.analyzeOnly, Flags.enableAssertMessage], beforeRun: (compiler) { compiler.impactCacheDeleter.retainCachesForTesting = true; }); @@ -139,7 +143,7 @@ Future compileWithDill( CompilationResult result = await runCompiler( entryPoint: entryPoint, memorySourceFiles: memorySourceFiles, - options: [Flags.useKernel]..addAll(options), + options: options, diagnosticHandler: diagnosticHandler, outputProvider: compilerOutput, beforeRun: (compiler) { diff --git a/tests/compiler/dart2js/kernel/helper.dart b/tests/compiler/dart2js/kernel/helper.dart index e395eaf4910..b8e6ae9185f 100644 --- a/tests/compiler/dart2js/kernel/helper.dart +++ b/tests/compiler/dart2js/kernel/helper.dart @@ -25,7 +25,7 @@ Future compile(String code, Flags.disableInlining, ]; if (disableTypeInference) options.add(Flags.disableTypeInference); - if (useKernel) options.add(Flags.useKernel); + if (!useKernel) options.add(Flags.useOldFrontend); options.addAll(extraOptions); if (lookup is String && lookup != 'main' && !code.contains('main')) { diff --git a/tests/compiler/dart2js/kernel/mixin_test.dart b/tests/compiler/dart2js/kernel/mixin_test.dart index 888c2751d10..62e4dfa4055 100644 --- a/tests/compiler/dart2js/kernel/mixin_test.dart +++ b/tests/compiler/dart2js/kernel/mixin_test.dart @@ -115,8 +115,9 @@ main(List args) { print( '---- compiler from ast -----------------------------------------------'); - var result = - await runCompiler(entryPoint: entryPoint, options: [Flags.analyzeOnly]); + var result = await runCompiler( + entryPoint: entryPoint, + options: [Flags.analyzeOnly, Flags.useOldFrontend]); Compiler compiler1 = result.compiler; Compiler compiler2 = await compileWithDill( diff --git a/tests/compiler/dart2js/kernel/run_from_dill_test.dart b/tests/compiler/dart2js/kernel/run_from_dill_test.dart index 6012cafa1d6..da6d490359b 100644 --- a/tests/compiler/dart2js/kernel/run_from_dill_test.dart +++ b/tests/compiler/dart2js/kernel/run_from_dill_test.dart @@ -102,7 +102,7 @@ Future mainInternal(List args, await runWithD8( entryPoint: entryPoint, memorySourceFiles: memorySourceFiles, - options: [Flags.useKernel, Flags.enableAssertMessage], + options: [Flags.enableAssertMessage], expectedOutput: OUTPUT); return ResultKind.success; diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart index 98c0651c058..70b26c04c86 100644 --- a/tests/compiler/dart2js/memory_compiler.dart +++ b/tests/compiler/dart2js/memory_compiler.dart @@ -144,7 +144,7 @@ CompilerImpl compilerFor( PackagesDiscoveryProvider packagesDiscoveryProvider}) { Uri libraryRoot = Uri.base.resolve('sdk/'); Uri platformBinaries; - if (options.contains(Flags.useKernel)) { + if (!options.contains(Flags.useOldFrontend)) { platformBinaries = computePlatformBinariesLocation(); } @@ -293,7 +293,5 @@ DiagnosticHandler createDiagnosticHandler(DiagnosticHandler diagnosticHandler, } main() { - runCompiler( - memorySourceFiles: {'main.dart': 'main() {}'}, - options: [Flags.useKernel]); + runCompiler(memorySourceFiles: {'main.dart': 'main() {}'}); } diff --git a/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart b/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart index 7e3cec6784a..bb819cb0ea4 100644 --- a/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart +++ b/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart @@ -6,7 +6,8 @@ // affect optimizations done on arrays. import 'package:expect/expect.dart'; -import "package:async_helper/async_helper.dart"; +import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart'; const MEMORY_SOURCE_FILES = const { @@ -32,7 +33,9 @@ main() { main() { asyncTest(() async { - var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); + var result = await runCompiler( + memorySourceFiles: MEMORY_SOURCE_FILES, + options: [Flags.useOldFrontend]); var compiler = result.compiler; var element = compiler.frontendStrategy.elementEnvironment.mainFunction; var code = compiler.backend.getGeneratedCode(element); diff --git a/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart b/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart index 40a6746bf7f..bfff8f165ca 100644 --- a/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart +++ b/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart @@ -9,12 +9,14 @@ import 'dart:async'; import 'package:expect/expect.dart'; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart'; Future runTest(String mainScript, test) async { CompilationResult result = await runCompiler( entryPoint: Uri.parse(mainScript), - memorySourceFiles: MEMORY_SOURCE_FILES); + memorySourceFiles: MEMORY_SOURCE_FILES, + options: [Flags.useOldFrontend]); test(result.compiler); } diff --git a/tests/compiler/dart2js/mirrors/import_mirrors_test.dart b/tests/compiler/dart2js/mirrors/import_mirrors_test.dart index 6ab305365ff..5a2017ff718 100644 --- a/tests/compiler/dart2js/mirrors/import_mirrors_test.dart +++ b/tests/compiler/dart2js/mirrors/import_mirrors_test.dart @@ -10,6 +10,7 @@ library dart2js.test.import_mirrors; import 'dart:async'; import 'package:expect/expect.dart'; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/diagnostics/messages.dart' show MessageKind, MessageTemplate; import '../memory_compiler.dart'; @@ -309,7 +310,7 @@ Future test(Map sourceFiles, expectedPaths = [expectedPaths]; } var collector = new DiagnosticCollector(); - var options = []; + var options = [Flags.useOldFrontend]; if (verbose) { options.add('--verbose'); } diff --git a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_test.dart b/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_test.dart index 092657cc5b7..2126ac996d4 100644 --- a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_test.dart +++ b/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_test.dart @@ -6,6 +6,7 @@ import 'package:expect/expect.dart'; import "package:async_helper/async_helper.dart"; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart' show runCompiler; import '../compiler_helper.dart' show findElement; import '../inference/type_mask_test_helper.dart'; @@ -25,7 +26,9 @@ main() { void main() { asyncTest(() async { - var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); + var result = await runCompiler( + memorySourceFiles: MEMORY_SOURCE_FILES, + options: [Flags.useOldFrontend]); var compiler = result.compiler; var element = findElement(compiler, 'field'); var typesInferrer = compiler.globalInference.typesInferrerInternal; diff --git a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_test.dart b/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_test.dart index 6b2af55abfa..8583e114cb4 100644 --- a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_test.dart +++ b/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_test.dart @@ -6,6 +6,7 @@ import 'package:expect/expect.dart'; import "package:async_helper/async_helper.dart"; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart' show runCompiler; import '../compiler_helper.dart' show findElement; import '../inference/type_mask_test_helper.dart'; @@ -25,7 +26,9 @@ main() { void main() { asyncTest(() async { - var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); + var result = await runCompiler( + memorySourceFiles: MEMORY_SOURCE_FILES, + options: [Flags.useOldFrontend]); var compiler = result.compiler; var element = findElement(compiler, 'field'); var typesInferrer = compiler.globalInference.typesInferrerInternal; diff --git a/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart b/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart index b017527bfe1..830b3b7a2f0 100644 --- a/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart +++ b/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart @@ -6,6 +6,7 @@ import 'package:expect/expect.dart'; import "package:async_helper/async_helper.dart"; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart' show runCompiler; import '../compiler_helper.dart' show findElement; @@ -38,7 +39,9 @@ class Super { void main() { asyncTest(() async { - var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); + var result = await runCompiler( + memorySourceFiles: MEMORY_SOURCE_FILES, + options: [Flags.useOldFrontend]); var compiler = result.compiler; dynamic superclass = diff --git a/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart b/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart index a430c3666f8..0afce8b91b9 100644 --- a/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart +++ b/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart @@ -5,6 +5,7 @@ // Test that tree-shaking hasn't been turned off. import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/compiler.dart'; import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend; import 'package:compiler/src/js_backend/mirrors_analysis.dart'; @@ -15,7 +16,9 @@ main() { DiagnosticCollector collector = new DiagnosticCollector(); asyncTest(() async { CompilationResult result = await runCompiler( - memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector); + memorySourceFiles: MEMORY_SOURCE_FILES, + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); Compiler compiler = result.compiler; JavaScriptBackend backend = compiler.backend; Expect.isTrue(collector.errors.isEmpty); diff --git a/tests/compiler/dart2js/mirrors/mirrors_used_test.dart b/tests/compiler/dart2js/mirrors/mirrors_used_test.dart index aef17ca92ec..377ddffdcb9 100644 --- a/tests/compiler/dart2js/mirrors/mirrors_used_test.dart +++ b/tests/compiler/dart2js/mirrors/mirrors_used_test.dart @@ -14,6 +14,7 @@ import "package:async_helper/async_helper.dart"; import '../memory_compiler.dart' show runCompiler; import 'package:compiler/src/apiimpl.dart' show CompilerImpl; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/constants/values.dart' show ConstantValue, TypeConstantValue; @@ -54,7 +55,7 @@ void main() { var result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: new LegacyCompilerDiagnostics(expectOnlyVerboseInfo), - options: ['--enable-experimental-mirrors']); + options: ['--enable-experimental-mirrors', Flags.useOldFrontend]); CompilerImpl compiler = result.compiler; JavaScriptBackend backend = compiler.backend; print(''); diff --git a/tests/compiler/dart2js/mirrors/preserve_uris_test.dart b/tests/compiler/dart2js/mirrors/preserve_uris_test.dart index 8429c81557a..6ecc464f0f7 100644 --- a/tests/compiler/dart2js/mirrors/preserve_uris_test.dart +++ b/tests/compiler/dart2js/mirrors/preserve_uris_test.dart @@ -5,6 +5,7 @@ import 'package:expect/expect.dart'; import 'package:async_helper/async_helper.dart'; import 'package:compiler/compiler_new.dart'; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart' show runCompiler, OutputCollector; const MEMORY_SOURCE_FILES = const { @@ -40,7 +41,7 @@ class Super { runTest(bool preserveUris) async { OutputCollector collector = new OutputCollector(); - var options = ["--minify"]; + var options = ["--minify", Flags.useOldFrontend]; if (preserveUris) options.add("--preserve-uris"); await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, diff --git a/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart b/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart index 4c79125e73b..9bff47f5c74 100644 --- a/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart +++ b/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart @@ -599,7 +599,7 @@ Future testData(TestData data) async { print( '--test ast----------------------------------------------------------'); await runTest( - [Flags.analyzeAll], + [Flags.useOldFrontend, Flags.analyzeAll], (Compiler compiler, FieldEntity field) => new AstEvaluationEnvironment( compiler, constantRequired: field.isConst)); @@ -607,8 +607,7 @@ Future testData(TestData data) async { if (!skipKernelList.contains(data.name)) { print( '--test kernel-------------------------------------------------------'); - await runTest([Flags.useKernel, Flags.analyzeOnly], - (Compiler compiler, FieldEntity field) { + await runTest([Flags.analyzeOnly], (Compiler compiler, FieldEntity field) { KernelFrontEndStrategy frontendStrategy = compiler.frontendStrategy; KernelToElementMap elementMap = frontendStrategy.elementMap; return new KernelEvaluationEnvironment(elementMap, null, field, diff --git a/tests/compiler/dart2js/model/constant_expression_test.dart b/tests/compiler/dart2js/model/constant_expression_test.dart index c115dae206c..44a1406d47e 100644 --- a/tests/compiler/dart2js/model/constant_expression_test.dart +++ b/tests/compiler/dart2js/model/constant_expression_test.dart @@ -9,8 +9,8 @@ import 'package:async_helper/async_helper.dart'; import 'package:expect/expect.dart'; import 'package:compiler/src/constants/expressions.dart'; import 'package:compiler/src/compiler.dart'; -import 'package:compiler/src/compile_time_constants.dart'; -import 'package:compiler/src/elements/elements.dart'; +import 'package:compiler/src/kernel/element_map_impl.dart'; +import 'package:compiler/src/elements/entities.dart'; import '../memory_compiler.dart'; import 'constant_expression_evaluate_test.dart' show MemoryEnvironment; @@ -56,7 +56,8 @@ const List DATA = const [ const ConstantData('"foo"', ConstantExpressionKind.STRING), const ConstantData('1 + 2', ConstantExpressionKind.BINARY), const ConstantData('1 == 2', ConstantExpressionKind.BINARY), - const ConstantData('1 != 2', ConstantExpressionKind.BINARY), + // TODO(sigmund): reenable (Issue 32511) + // const ConstantData('1 != 2', ConstantExpressionKind.BINARY), const ConstantData('1 ?? 2', ConstantExpressionKind.BINARY), const ConstantData('-(1)', ConstantExpressionKind.UNARY, text: '-1'), const ConstantData('"foo".length', ConstantExpressionKind.STRING_LENGTH), @@ -154,34 +155,35 @@ class C { const ConstantData( 'const A(field1: 87)', ConstantExpressionKind.CONSTRUCTED, type: 'A', fields: const {'field(A#field1)': '87'}), - const ConstantData('const B()', ConstantExpressionKind.CONSTRUCTED, - type: 'A>', - fields: const { - 'field(A#field1)': '42', - }), - const ConstantData('const B()', ConstantExpressionKind.CONSTRUCTED, - type: 'A>', - fields: const { - 'field(A#field1)': '42', - }), - const ConstantData( - 'const B(field1: 87)', ConstantExpressionKind.CONSTRUCTED, - type: 'A>', - fields: const { - 'field(A#field1)': '87', - }), - const ConstantData( - 'const C(field1: 87)', ConstantExpressionKind.CONSTRUCTED, - type: 'A>', - fields: const { - 'field(A#field1)': '87', - }), - const ConstantData( - 'const B.named()', ConstantExpressionKind.CONSTRUCTED, - type: 'A', - fields: const { - 'field(A#field1)': '42', - }), + // TODO(sigmund): reenable (Issue 32511) + //const ConstantData('const B()', ConstantExpressionKind.CONSTRUCTED, + // type: 'A>', + // fields: const { + // 'field(A#field1)': '42', + // }), + //const ConstantData('const B()', ConstantExpressionKind.CONSTRUCTED, + // type: 'A>', + // fields: const { + // 'field(A#field1)': '42', + // }), + //const ConstantData( + // 'const B(field1: 87)', ConstantExpressionKind.CONSTRUCTED, + // type: 'A>', + // fields: const { + // 'field(A#field1)': '87', + // }), + //const ConstantData( + // 'const C(field1: 87)', ConstantExpressionKind.CONSTRUCTED, + // type: 'A>', + // fields: const { + // 'field(A#field1)': '87', + // }), + //const ConstantData( + // 'const B.named()', ConstantExpressionKind.CONSTRUCTED, + // type: 'A', + // fields: const { + // 'field(A#field1)': '42', + // }), ]), ]; @@ -203,12 +205,17 @@ Future testData(TestData data) async { CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': source}, options: ['--analyze-all']); Compiler compiler = result.compiler; - MemoryEnvironment environment = - new MemoryEnvironment(new AstEvaluationEnvironment(compiler)); - dynamic library = compiler.frontendStrategy.elementEnvironment.mainLibrary; + var elementEnvironment = compiler.frontendStrategy.elementEnvironment; + + MemoryEnvironment environment = new MemoryEnvironment( + new KernelEvaluationEnvironment( + (compiler.frontendStrategy as dynamic).elementMap, + compiler.environment, + null)); + dynamic library = elementEnvironment.mainLibrary; constants.forEach((String name, ConstantData data) { - FieldElement field = library.localLookup(name); - dynamic constant = field.constant; + FieldEntity field = elementEnvironment.lookupLibraryMember(library, name); + dynamic constant = elementEnvironment.getFieldConstant(field); Expect.equals( data.kind, constant.kind, @@ -237,6 +244,8 @@ Future testData(TestData data) async { "`${constant.toDartText()}`, expected '${data.fields.length}'."); instanceFields.forEach((field, expression) { String name = '$field'; + Expect.isTrue(name.startsWith('k:')); + name = name.substring(2).replaceAll('.', "#"); String expression = instanceFields[field].toDartText(); String expected = data.fields[name]; Expect.equals( diff --git a/tests/compiler/dart2js/no_such_method_enabled_test.dart b/tests/compiler/dart2js/no_such_method_enabled_test.dart index 74c1826a8b2..68ff7c5bb42 100644 --- a/tests/compiler/dart2js/no_such_method_enabled_test.dart +++ b/tests/compiler/dart2js/no_such_method_enabled_test.dart @@ -212,7 +212,7 @@ main() { print(test.code); CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': test.code}, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Compiler compiler = result.compiler; checkTest(compiler, test); } diff --git a/tests/compiler/dart2js/old_frontend/analyze_all_test.dart b/tests/compiler/dart2js/old_frontend/analyze_all_test.dart index b6daf1c6b9f..4936c1c914b 100644 --- a/tests/compiler/dart2js/old_frontend/analyze_all_test.dart +++ b/tests/compiler/dart2js/old_frontend/analyze_all_test.dart @@ -34,7 +34,7 @@ Future run(String source, {bool analyzeAll, bool expectSuccess}) async { DiagnosticCollector collector = new DiagnosticCollector(); - List options = []; + List options = [Flags.useOldFrontend]; if (analyzeAll) { options.add(Flags.analyzeAll); } else { diff --git a/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart b/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart index 9375f46346b..7ff112a425a 100644 --- a/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart +++ b/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart @@ -31,6 +31,7 @@ main(List arguments) { bool verbose = arguments.contains('-v'); List options = [ + Flags.useOldFrontend, Flags.analyzeOnly, Flags.analyzeMain, '--categories=Client,Server' diff --git a/tests/compiler/dart2js/old_frontend/analyze_helper.dart b/tests/compiler/dart2js/old_frontend/analyze_helper.dart index e11223ee128..851e1e39075 100644 --- a/tests/compiler/dart2js/old_frontend/analyze_helper.dart +++ b/tests/compiler/dart2js/old_frontend/analyze_helper.dart @@ -232,6 +232,7 @@ Future analyze( var provider = new CompilerSourceFileProvider(); var handler = new CollectingDiagnosticHandler(whiteList, skipList, provider); options = [ + Flags.useOldFrontend, Flags.analyzeOnly, '--categories=Client,Server', Flags.showPackageWarnings diff --git a/tests/compiler/dart2js/old_frontend/analyze_only_test.dart b/tests/compiler/dart2js/old_frontend/analyze_only_test.dart index 9b88dc9d75b..efe3c52d847 100644 --- a/tests/compiler/dart2js/old_frontend/analyze_only_test.dart +++ b/tests/compiler/dart2js/old_frontend/analyze_only_test.dart @@ -40,6 +40,7 @@ runCompiler(String main, List options, } } + options = [Flags.useOldFrontend]..addAll(options); print('-----------------------------------------------'); print('main source:\n$main'); print('options: $options\n'); diff --git a/tests/compiler/dart2js/old_frontend/bad_loop_test.dart b/tests/compiler/dart2js/old_frontend/bad_loop_test.dart index 889cecdcf98..8148664ab99 100644 --- a/tests/compiler/dart2js/old_frontend/bad_loop_test.dart +++ b/tests/compiler/dart2js/old_frontend/bad_loop_test.dart @@ -35,7 +35,10 @@ main() { provider, new LegacyCompilerOutput(), new LegacyCompilerDiagnostics(diagnosticHandler), - new CompilerOptions(libraryRoot: libraryRoot, packageRoot: packageRoot)); + new CompilerOptions( + libraryRoot: libraryRoot, + useKernel: false, + packageRoot: packageRoot)); asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) { Expect.isTrue(compiler.compilationFailed); Expect.equals(5, errorCount); diff --git a/tests/compiler/dart2js/old_frontend/benign_error_test.dart b/tests/compiler/dart2js/old_frontend/benign_error_test.dart index 9fd009f9397..a94a5aa25a8 100644 --- a/tests/compiler/dart2js/old_frontend/benign_error_test.dart +++ b/tests/compiler/dart2js/old_frontend/benign_error_test.dart @@ -7,6 +7,7 @@ import '../memory_compiler.dart'; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/compiler.dart'; import 'package:compiler/src/diagnostics/messages.dart'; import 'package:compiler/src/js_backend/js_backend.dart'; @@ -28,7 +29,9 @@ testExamples(MessageKind kind) async { } DiagnosticCollector collector = new DiagnosticCollector(); CompilationResult result = await runCompiler( - memorySourceFiles: example, diagnosticHandler: collector); + memorySourceFiles: example, + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); Expect .isTrue(collector.errors.any((message) => message.messageKind == kind)); diff --git a/tests/compiler/dart2js/old_frontend/categories_test.dart b/tests/compiler/dart2js/old_frontend/categories_test.dart index d1b8eaa90ff..6b4317c6436 100644 --- a/tests/compiler/dart2js/old_frontend/categories_test.dart +++ b/tests/compiler/dart2js/old_frontend/categories_test.dart @@ -4,6 +4,7 @@ import "package:expect/expect.dart"; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import "../memory_compiler.dart"; @@ -11,7 +12,7 @@ runTest(String source, String categories, int expectedErrors) async { var collector = new DiagnosticCollector(); await runCompiler( memorySourceFiles: {"main.dart": source}, - options: ["--categories=$categories"], + options: ["--categories=$categories", Flags.useOldFrontend], diagnosticHandler: collector); Expect.equals(expectedErrors, collector.errors.length); Expect.equals(0, collector.warnings.length); diff --git a/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart b/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart index 3d0bea5890d..f394e6d5237 100644 --- a/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart +++ b/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'package:async_helper/async_helper.dart'; import 'package:compiler/src/apiimpl.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:expect/expect.dart'; import 'package:compiler/src/elements/entities.dart' show ClassEntity; import 'package:compiler/src/resolution/class_members.dart' @@ -14,7 +15,8 @@ import '../memory_compiler.dart'; const String DART2JS_SOURCE = 'pkg/compiler/lib/src/dart2js.dart'; const List DART2JS_OPTIONS = const [ '--categories=Client,Server', - '--disable-type-inference' + '--disable-type-inference', + Flags.useOldFrontend ]; Iterable computeLiveClasses(CompilerImpl compiler) { diff --git a/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart b/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart index 30f9535f940..3ff105c446d 100644 --- a/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart +++ b/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart @@ -44,7 +44,7 @@ Future test(Uri entryPoint, print('=================================================================='); print('test: $entryPoint showPackageWarnings=$showPackageWarnings ' 'suppressHints=$suppressHints'); - var options = [Flags.analyzeOnly]; + var options = [Flags.analyzeOnly, Flags.useOldFrontend]; if (showPackageWarnings) { options.add(Flags.showPackageWarnings); } diff --git a/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart b/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart index 53538ed95f1..6e8708b196b 100644 --- a/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart +++ b/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/compiler_new.dart' show Diagnostic; import 'package:expect/expect.dart'; import '../memory_compiler.dart'; @@ -13,7 +14,7 @@ void main() { CompilationResult result = await runCompiler( memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector, - options: ['--analyze-all']); + options: ['--analyze-all', Flags.useOldFrontend]); List diagnostics = []; collector.messages.forEach((CollectedMessage message) { diff --git a/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart b/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart index 0f10f25f398..ea030a3c011 100644 --- a/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart +++ b/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart @@ -30,7 +30,7 @@ Future test(Map source, memorySourceFiles: source, diagnosticHandler: collector, showDiagnostics: true, - options: [Flags.analyzeOnly, Flags.analyzeAll], + options: [Flags.analyzeOnly, Flags.analyzeAll, Flags.useOldFrontend], packageRoot: Uri.parse('memory:pkg/')); Expect.isTrue(collector.errors.isEmpty); diff --git a/tests/compiler/dart2js/old_frontend/error_token_test.dart b/tests/compiler/dart2js/old_frontend/error_token_test.dart index 7cdd28fdbd3..fb0854e468d 100644 --- a/tests/compiler/dart2js/old_frontend/error_token_test.dart +++ b/tests/compiler/dart2js/old_frontend/error_token_test.dart @@ -8,6 +8,7 @@ library dart2js.test.error_token; import 'dart:async'; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import "package:compiler/src/diagnostics/messages.dart"; import 'package:expect/expect.dart'; import '../memory_compiler.dart'; @@ -20,7 +21,8 @@ Future runTest(String code, entryPoint: Uri.parse('memory:main.dart'), memorySourceFiles: {'main.dart': code}, diagnosticHandler: diagnostics, - outputProvider: output); + outputProvider: output, + options: [Flags.useOldFrontend]); Expect.equals(error != null ? 1 : 0, diagnostics.errors.length); if (error != null) diff --git a/tests/compiler/dart2js/old_frontend/frontend_checker.dart b/tests/compiler/dart2js/old_frontend/frontend_checker.dart index 7699405ad61..7fc1552c4d3 100644 --- a/tests/compiler/dart2js/old_frontend/frontend_checker.dart +++ b/tests/compiler/dart2js/old_frontend/frontend_checker.dart @@ -48,7 +48,8 @@ void check(Map> testFiles, entryPoint: Uri.parse('memory:$testFileName'), memorySourceFiles: {testFileName: testSources[testName]}, diagnosticHandler: collector, - options: [Flags.analyzeOnly]..addAll(options), + options: [Flags.analyzeOnly, Flags.useOldFrontend] + ..addAll(options), showDiagnostics: verbose, cachedCompiler: cachedCompiler); var compiler = result.compiler; diff --git a/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart b/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart index 1e34c9aada3..7d352c0d6dc 100644 --- a/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart +++ b/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart @@ -14,6 +14,7 @@ library dart2js.test.generic_method_type_usage; import 'dart:async'; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import "package:compiler/src/diagnostics/messages.dart"; import 'package:expect/expect.dart'; import '../memory_compiler.dart'; @@ -90,7 +91,7 @@ Future runTest(Uri main, {MessageKind warning, MessageKind info}) async { OutputCollector output = new OutputCollector(); await runCompiler( entryPoint: main, - options: const ["--generic-method-syntax"], + options: const ["--generic-method-syntax", Flags.useOldFrontend], memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: diagnostics, outputProvider: output); diff --git a/tests/compiler/dart2js/old_frontend/import_test.dart b/tests/compiler/dart2js/old_frontend/import_test.dart index de6daee066b..59f5362a416 100644 --- a/tests/compiler/dart2js/old_frontend/import_test.dart +++ b/tests/compiler/dart2js/old_frontend/import_test.dart @@ -8,6 +8,7 @@ library dart2js.test.import; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/diagnostics/messages.dart'; import '../memory_compiler.dart'; @@ -45,7 +46,8 @@ testEntryPointIsPart() async { await runCompiler( entryPoint: Uri.parse('memory:part.dart'), memorySourceFiles: MEMORY_SOURCE_FILES, - diagnosticHandler: collector); + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); collector.checkMessages([const Expected.error(MessageKind.MAIN_HAS_PART_OF)]); } @@ -55,7 +57,8 @@ testImportPart() async { await runCompiler( entryPoint: Uri.parse('memory:lib.dart'), memorySourceFiles: MEMORY_SOURCE_FILES, - diagnosticHandler: collector); + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); collector.checkMessages([ const Expected.error(MessageKind.IMPORT_PART_OF), @@ -66,7 +69,9 @@ testImportPart() async { testMissingImports() async { var collector = new DiagnosticCollector(); await runCompiler( - memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector); + memorySourceFiles: MEMORY_SOURCE_FILES, + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); collector.checkMessages([ const Expected.error(MessageKind.READ_URI_ERROR), @@ -81,7 +86,8 @@ testMissingMain() async { var collector = new DiagnosticCollector(); await runCompiler( entryPoint: Uri.parse('memory:missing.dart'), - diagnosticHandler: collector); + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); collector.checkMessages([const Expected.error(MessageKind.READ_SELF_ERROR)]); } diff --git a/tests/compiler/dart2js/old_frontend/library_resolution_test.dart b/tests/compiler/dart2js/old_frontend/library_resolution_test.dart index 34742a3d307..a698aba4573 100644 --- a/tests/compiler/dart2js/old_frontend/library_resolution_test.dart +++ b/tests/compiler/dart2js/old_frontend/library_resolution_test.dart @@ -38,7 +38,9 @@ class CustomCompiler extends CompilerImpl { const NullCompilerOutput(), handler, new CompilerOptions( - libraryRoot: libraryRoot, packageConfig: packageConfig)); + libraryRoot: libraryRoot, + useKernel: false, + packageConfig: packageConfig)); } main() async { diff --git a/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart b/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart index a3b52ea2767..d5affd7af1b 100644 --- a/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart +++ b/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart @@ -9,6 +9,7 @@ library dart2js.test.malformed_uri; import 'package:expect/expect.dart'; import "package:async_helper/async_helper.dart"; +import 'package:compiler/src/commandline_options.dart'; import '../memory_compiler.dart'; const MEMORY_SOURCE_FILES = const { @@ -23,7 +24,9 @@ testMalformedUri() { asyncTest(() async { var collector = new DiagnosticCollector(); await runCompiler( - memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: collector); + memorySourceFiles: MEMORY_SOURCE_FILES, + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); Expect.equals(1, collector.errors.length); }); } diff --git a/tests/compiler/dart2js/old_frontend/members_test.dart b/tests/compiler/dart2js/old_frontend/members_test.dart index f0f03cbdaef..2ca4b90db94 100644 --- a/tests/compiler/dart2js/old_frontend/members_test.dart +++ b/tests/compiler/dart2js/old_frontend/members_test.dart @@ -7,6 +7,7 @@ library members_test; import 'package:expect/expect.dart'; import "package:async_helper/async_helper.dart"; import '../type_test_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/elements/resolution_types.dart'; import "package:compiler/src/elements/elements.dart" show ClassElement, MemberSignature; @@ -187,7 +188,9 @@ void testClassMembers() { class C extends B {} class D extends C {} class E extends D {} - """, compileMode: CompileMode.memory).then((env) { + """, + options: [Flags.useOldFrontend], + compileMode: CompileMode.memory).then((env) { ResolutionInterfaceType bool_ = env['bool']; ResolutionInterfaceType String_ = env['String']; ResolutionInterfaceType int_ = env['int']; @@ -445,7 +448,7 @@ void testInterfaceMembers() { num method4(); } abstract class D implements A, B, C {} - """).then((env) { + """, options: [Flags.useOldFrontend]).then((env) { ResolutionDynamicType dynamic_ = env['dynamic']; ResolutionVoidType void_ = env['void']; ResolutionInterfaceType num_ = env['num']; @@ -614,7 +617,7 @@ void testClassVsInterfaceMembers() { method2(a); } abstract class C extends A implements B {} - """).then((env) { + """, options: [Flags.useOldFrontend]).then((env) { ResolutionDynamicType dynamic_ = env['dynamic']; ResolutionInterfaceType A = env['A']; @@ -665,7 +668,7 @@ void testMixinMembers() { method3(S a) {} } abstract class C extends Object with A implements B {} - """).then((env) { + """, options: [Flags.useOldFrontend]).then((env) { ResolutionDynamicType dynamic_ = env['dynamic']; ClassElement A = env.getElement('A'); @@ -734,7 +737,7 @@ void testMixinMembersWithoutImplements() { abstract class B implements A { } abstract class C extends Object with B {} - """).then((env) { + """, options: [Flags.useOldFrontend]).then((env) { ResolutionDynamicType dynamic_ = env['dynamic']; ResolutionInterfaceType A = env['A']; diff --git a/tests/compiler/dart2js/old_frontend/message_kind_helper.dart b/tests/compiler/dart2js/old_frontend/message_kind_helper.dart index 0703acda780..f869e394708 100644 --- a/tests/compiler/dart2js/old_frontend/message_kind_helper.dart +++ b/tests/compiler/dart2js/old_frontend/message_kind_helper.dart @@ -69,8 +69,11 @@ Future check(MessageTemplate template, Compiler cachedCompiler) { Compiler compiler = compilerFor( memorySourceFiles: example, diagnosticHandler: collector, - options: [Flags.analyzeOnly, Flags.enableExperimentalMirrors] - ..addAll(template.options), + options: [ + Flags.analyzeOnly, + Flags.enableExperimentalMirrors, + Flags.useOldFrontend + ]..addAll(template.options), cachedCompiler: cachedCompiler); return compiler.run(Uri.parse('memory:main.dart')).then((_) { diff --git a/tests/compiler/dart2js/old_frontend/message_span_test.dart b/tests/compiler/dart2js/old_frontend/message_span_test.dart index 9fff9b59195..35009d7ec3f 100644 --- a/tests/compiler/dart2js/old_frontend/message_span_test.dart +++ b/tests/compiler/dart2js/old_frontend/message_span_test.dart @@ -146,7 +146,7 @@ main() { DiagnosticCollector collector = new DiagnosticCollector(); CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': test.code}, - options: [Flags.analyzeOnly], + options: [Flags.analyzeOnly, Flags.useOldFrontend], diagnosticHandler: collector, cachedCompiler: cachedCompiler); cachedCompiler = result.compiler; diff --git a/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart b/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart index b0c0d4e0ee6..00a037ae420 100644 --- a/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart +++ b/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart @@ -1,4 +1,5 @@ import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/diagnostics/messages.dart'; import 'package:expect/expect.dart'; import '../memory_compiler.dart'; @@ -10,7 +11,9 @@ runTest(String code, print(code); DiagnosticCollector collector = new DiagnosticCollector(); await runCompiler( - memorySourceFiles: {'main.dart': code}, diagnosticHandler: collector); + memorySourceFiles: {'main.dart': code}, + diagnosticHandler: collector, + options: [Flags.useOldFrontend]); Expect.equals(0, collector.errors.length, "Unexpected errors."); Expect.listEquals( expectedWarnings, diff --git a/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart b/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart index 5cebcf249b1..c266e932656 100644 --- a/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart +++ b/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart @@ -5,6 +5,7 @@ // Test that elements are not needlessly required by dart2js. import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/src/common/names.dart'; import 'package:compiler/src/compiler.dart'; import 'package:compiler/src/elements/elements.dart'; @@ -36,7 +37,8 @@ void checkInstantiated(Compiler compiler, ClassElement cls, bool expected) { analyze(String code, {bool proxyConstantComputed: false, bool deprecatedClass: false}) async { CompilationResult result = await runCompiler( - memorySourceFiles: {'main.dart': code}, options: ['--analyze-only']); + memorySourceFiles: {'main.dart': code}, + options: ['--analyze-only', Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; Expect.equals( diff --git a/tests/compiler/dart2js/old_frontend/missing_file_test.dart b/tests/compiler/dart2js/old_frontend/missing_file_test.dart index 92c48917d18..5fdbb8ae3b0 100644 --- a/tests/compiler/dart2js/old_frontend/missing_file_test.dart +++ b/tests/compiler/dart2js/old_frontend/missing_file_test.dart @@ -8,6 +8,7 @@ library dart2js.test.missing_file; import 'dart:async'; import 'package:async_helper/async_helper.dart'; +import 'package:compiler/src/commandline_options.dart'; import "package:compiler/src/diagnostics/messages.dart"; import 'package:expect/expect.dart'; import '../memory_compiler.dart'; @@ -36,7 +37,8 @@ Future runTest(Uri main, {MessageKind error, MessageKind info}) async { entryPoint: main, memorySourceFiles: MEMORY_SOURCE_FILES, diagnosticHandler: diagnostics, - outputProvider: output); + outputProvider: output, + options: [Flags.useOldFrontend]); Expect.isFalse(output.hasExtraOutput); Expect.equals(error != null ? 1 : 0, diagnostics.errors.length); diff --git a/tests/compiler/dart2js/old_frontend/mock_compiler.dart b/tests/compiler/dart2js/old_frontend/mock_compiler.dart index 94ea07a6860..1ecfdfe7ab7 100644 --- a/tests/compiler/dart2js/old_frontend/mock_compiler.dart +++ b/tests/compiler/dart2js/old_frontend/mock_compiler.dart @@ -93,6 +93,7 @@ class MockCompiler extends Compiler { options: new CompilerOptions( entryPoint: new Uri(scheme: 'mock'), libraryRoot: Uri.parse('placeholder_library_root_for_mock/'), + useKernel: false, enableTypeAssertions: enableTypeAssertions, enableUserAssertions: enableUserAssertions, disableInlining: disableInlining, diff --git a/tests/compiler/dart2js/old_frontend/package_root_test.dart b/tests/compiler/dart2js/old_frontend/package_root_test.dart index 2e60fc93bc7..793d17f91b1 100644 --- a/tests/compiler/dart2js/old_frontend/package_root_test.dart +++ b/tests/compiler/dart2js/old_frontend/package_root_test.dart @@ -10,6 +10,7 @@ import 'dart:async'; import 'package:async_helper/async_helper.dart'; import 'package:expect/expect.dart'; +import 'package:compiler/src/commandline_options.dart'; import 'package:compiler/compiler.dart' show PackagesDiscoveryProvider; import 'package:compiler/src/diagnostics/messages.dart' show MessageKind; import 'package:package_config/packages.dart'; @@ -41,7 +42,8 @@ Future runTest(Uri main, MessageKind expectedMessageKind, diagnosticHandler: collector, packageRoot: packageRoot, packageConfig: packageConfig, - packagesDiscoveryProvider: packagesDiscoveryProvider); + packagesDiscoveryProvider: packagesDiscoveryProvider, + options: [Flags.useOldFrontend]); Expect.equals( 1, collector.errors.length, "Unexpected errors: ${collector.errors}"); Expect.equals(expectedMessageKind, collector.errors.first.message.kind, diff --git a/tests/compiler/dart2js/old_frontend/related_types.dart b/tests/compiler/dart2js/old_frontend/related_types.dart index 9a64e22d0ce..26f96079838 100644 --- a/tests/compiler/dart2js/old_frontend/related_types.dart +++ b/tests/compiler/dart2js/old_frontend/related_types.dart @@ -25,7 +25,11 @@ main(List arguments) async { Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.last)); CompilationResult result = await runCompiler( entryPoint: entryPoint, - options: [Flags.analyzeOnly, '--categories=Client,Server']); + options: [ + Flags.analyzeOnly, + '--categories=Client,Server', + Flags.useOldFrontend + ]); if (result.isSuccess) { checkRelatedTypes(result.compiler); } diff --git a/tests/compiler/dart2js/old_frontend/related_types_test.dart b/tests/compiler/dart2js/old_frontend/related_types_test.dart index dda4a7606fd..963afa23d3e 100644 --- a/tests/compiler/dart2js/old_frontend/related_types_test.dart +++ b/tests/compiler/dart2js/old_frontend/related_types_test.dart @@ -263,7 +263,7 @@ main(List arguments) { DiagnosticCollector collector = new DiagnosticCollector(); CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': CODE}, - options: [Flags.analyzeOnly, Flags.analyzeMain], + options: [Flags.analyzeOnly, Flags.analyzeMain, Flags.useOldFrontend], diagnosticHandler: collector); Expect.isFalse( collector.hasRegularMessages, "Unexpected analysis messages."); diff --git a/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart b/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart index f72ea1601b2..3ce95aa041e 100644 --- a/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart +++ b/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart @@ -295,7 +295,7 @@ Future test( CompilationResult result = await runCompiler( memorySourceFiles: sourceFiles, - options: [Flags.analyzeAll, Flags.analyzeOnly]); + options: [Flags.analyzeAll, Flags.analyzeOnly, Flags.useOldFrontend]); Compiler compiler = result.compiler; testMap.forEach((String filename, Test test) { LibraryElement library = diff --git a/tests/compiler/dart2js/old_frontend/space_test.dart b/tests/compiler/dart2js/old_frontend/space_test.dart index 0f01faba9ab..8ffc6471421 100644 --- a/tests/compiler/dart2js/old_frontend/space_test.dart +++ b/tests/compiler/dart2js/old_frontend/space_test.dart @@ -15,6 +15,7 @@ main() { return dart2js.main([ "--library-root=${libraryRoot.toFilePath()}", Flags.analyzeOnly, + Flags.useOldFrontend, "file with spaces.dart" ]); } diff --git a/tests/compiler/dart2js/old_frontend/warnings_checker.dart b/tests/compiler/dart2js/old_frontend/warnings_checker.dart index b974781951f..2bb7c4e65c1 100644 --- a/tests/compiler/dart2js/old_frontend/warnings_checker.dart +++ b/tests/compiler/dart2js/old_frontend/warnings_checker.dart @@ -43,7 +43,7 @@ void checkWarnings(Map tests, [List arguments]) { await runCompiler( entryPoint: uri, diagnosticHandler: collector, - options: [Flags.analyzeOnly], + options: [Flags.analyzeOnly, Flags.useOldFrontend], showDiagnostics: verbose); Map> statusMap = tests[test]; // Line numbers with known unexpected warnings. diff --git a/tests/compiler/dart2js/output_type_test.dart b/tests/compiler/dart2js/output_type_test.dart index 0e07a759fca..34c18a1e75c 100644 --- a/tests/compiler/dart2js/output_type_test.dart +++ b/tests/compiler/dart2js/output_type_test.dart @@ -40,8 +40,8 @@ Future test(List arguments, List expectedOutput, {List groupOutputs: const [], bool useKernel}) async { List options = new List.from(arguments) ..add("--library-root=${Uri.base.resolve('sdk/')}"); - if (useKernel) { - options.add(Flags.useKernel); + if (!useKernel) { + options.add(Flags.useOldFrontend); } print('--------------------------------------------------------------------'); print('dart2js ${options.join(' ')}'); diff --git a/tests/compiler/dart2js/rti/backend_type_helper_test.dart b/tests/compiler/dart2js/rti/backend_type_helper_test.dart index 6d47050836c..9c723306430 100644 --- a/tests/compiler/dart2js/rti/backend_type_helper_test.dart +++ b/tests/compiler/dart2js/rti/backend_type_helper_test.dart @@ -18,7 +18,7 @@ main() { runTest({bool useKernel}) async { CompilationResult result = await runCompiler( entryPoint: Platform.script.resolve('data/subtype_named_args.dart'), - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/rti/disable_rti_test.dart b/tests/compiler/dart2js/rti/disable_rti_test.dart index ab733d852bc..67b3e3df77e 100644 --- a/tests/compiler/dart2js/rti/disable_rti_test.dart +++ b/tests/compiler/dart2js/rti/disable_rti_test.dart @@ -60,7 +60,7 @@ main() { CompilationResult result = await runCompiler( memorySourceFiles: {'main.dart': code}, options: [Flags.disableRtiOptimization, Flags.disableInlining] - ..addAll(useKernel ? [Flags.useKernel] : [])); + ..addAll(useKernel ? [] : [Flags.useOldFrontend])); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/rti/factory_call_test.dart b/tests/compiler/dart2js/rti/factory_call_test.dart index ed72d73f95b..d3632ae1569 100644 --- a/tests/compiler/dart2js/rti/factory_call_test.dart +++ b/tests/compiler/dart2js/rti/factory_call_test.dart @@ -40,8 +40,7 @@ main() { main() { asyncTest(() async { CompilationResult result = await runCompiler( - memorySourceFiles: {'main.dart': code}, - options: [Flags.strongMode, Flags.useKernel]); + memorySourceFiles: {'main.dart': code}, options: [Flags.strongMode]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/rti/instance_call_test.dart b/tests/compiler/dart2js/rti/instance_call_test.dart index b96d84181ff..352392432a0 100644 --- a/tests/compiler/dart2js/rti/instance_call_test.dart +++ b/tests/compiler/dart2js/rti/instance_call_test.dart @@ -99,8 +99,7 @@ main() { main() { asyncTest(() async { CompilationResult result = await runCompiler( - memorySourceFiles: {'main.dart': code}, - options: [Flags.strongMode, Flags.useKernel]); + memorySourceFiles: {'main.dart': code}, options: [Flags.strongMode]); Expect.isTrue(result.isSuccess); Compiler compiler = result.compiler; ClosedWorld closedWorld = compiler.backendClosedWorldForTesting; diff --git a/tests/compiler/dart2js/serialization/analysis_test_helper.dart b/tests/compiler/dart2js/serialization/analysis_test_helper.dart index 64c7c524a00..8c48c7cfd15 100644 --- a/tests/compiler/dart2js/serialization/analysis_test_helper.dart +++ b/tests/compiler/dart2js/serialization/analysis_test_helper.dart @@ -51,7 +51,7 @@ Future analyze(Uri entryPoint, entryPoint: entryPoint, resolutionInputs: resolutionInputs, memorySourceFiles: sourceFiles, - options: [Flags.analyzeOnly], + options: [Flags.analyzeOnly, Flags.useOldFrontend], diagnosticHandler: diagnosticCollector); if (test != null) { Expect.equals(test.expectedErrorCount, diagnosticCollector.errors.length, diff --git a/tests/compiler/dart2js/serialization/compilation_test_helper.dart b/tests/compiler/dart2js/serialization/compilation_test_helper.dart index 05f76b25c32..f1d22dd01e3 100644 --- a/tests/compiler/dart2js/serialization/compilation_test_helper.dart +++ b/tests/compiler/dart2js/serialization/compilation_test_helper.dart @@ -51,7 +51,7 @@ Future compile(Uri entryPoint, String title = '${id}${testDescription}'; OutputCollector outputCollector = new OutputCollector(); await measure(title, 'compile', () async { - List options = []; + List options = [Flags.useOldFrontend]; if (test != null && test.checkedMode) { options.add(Flags.enableCheckedMode); } diff --git a/tests/compiler/dart2js/serialization/duplicate_library_test.dart b/tests/compiler/dart2js/serialization/duplicate_library_test.dart index 854cc0ac96b..7f8ecebeb45 100644 --- a/tests/compiler/dart2js/serialization/duplicate_library_test.dart +++ b/tests/compiler/dart2js/serialization/duplicate_library_test.dart @@ -27,7 +27,7 @@ void main(List args) { memorySourceFiles: sourceFiles, resolutionInputs: resolutionInputs, diagnosticHandler: collector, - options: [Flags.analyzeAll]); + options: [Flags.analyzeAll, Flags.useOldFrontend]); Expect.isTrue(collector.errors.isNotEmpty, "Expected duplicate serialized library errors."); }); diff --git a/tests/compiler/dart2js/serialization/equivalence_test.dart b/tests/compiler/dart2js/serialization/equivalence_test.dart index 8aa3f25ae08..027df4e6890 100644 --- a/tests/compiler/dart2js/serialization/equivalence_test.dart +++ b/tests/compiler/dart2js/serialization/equivalence_test.dart @@ -92,7 +92,11 @@ main(List arguments) { CompilationResult result = await runCompiler( memorySourceFiles: sourceFiles, entryPoint: entryPoint, - options: [Flags.analyzeAll, Flags.genericMethodSyntax]); + options: [ + Flags.analyzeAll, + Flags.genericMethodSyntax, + Flags.useOldFrontend + ]); Compiler compiler = result.compiler; testSerialization(compiler.libraryLoader.libraries, compiler.reporter, compiler.resolution, compiler.libraryLoader, diff --git a/tests/compiler/dart2js/serialization/helper.dart b/tests/compiler/dart2js/serialization/helper.dart index 0a1f80a3a75..4770141c2f5 100644 --- a/tests/compiler/dart2js/serialization/helper.dart +++ b/tests/compiler/dart2js/serialization/helper.dart @@ -162,7 +162,7 @@ Future serialize(Uri entryPoint, } OutputCollector outputCollector = new OutputCollector(); Compiler compiler = compilerFor( - options: [Flags.resolveOnly], + options: [Flags.resolveOnly, Flags.useOldFrontend], memorySourceFiles: memorySourceFiles, resolutionInputs: resolutionInputs, outputProvider: outputCollector); @@ -243,7 +243,7 @@ Future> preserializeData( entryPoint: test.sourceFiles.isEmpty ? uriList.first : null, memorySourceFiles: sourceFiles, resolutionInputs: serializedData.toUris(), - options: [Flags.resolveOnly], + options: [Flags.resolveOnly, Flags.useOldFrontend], outputProvider: outputCollector); compiler.librariesToAnalyzeWhenRun = uriList; await compiler.run(null); diff --git a/tests/compiler/dart2js/serialization/model_test_helper.dart b/tests/compiler/dart2js/serialization/model_test_helper.dart index 8a6a8078b54..976b5653f61 100644 --- a/tests/compiler/dart2js/serialization/model_test_helper.dart +++ b/tests/compiler/dart2js/serialization/model_test_helper.dart @@ -68,7 +68,8 @@ Future checkModels(Uri entryPoint, String title = '${id}${testDescription}'; Compiler compilerNormal = await measure(title, 'compile normal', () async { Compiler compilerNormal = compilerFor( - memorySourceFiles: sourceFiles, options: [Flags.analyzeOnly]); + memorySourceFiles: sourceFiles, + options: [Flags.analyzeOnly, Flags.useOldFrontend]); compilerNormal.impactCacheDeleter.retainCachesForTesting = true; await compilerNormal.run(entryPoint); ElementEnvironment elementEnvironment = @@ -82,7 +83,7 @@ Future checkModels(Uri entryPoint, Compiler compilerDeserialized = compilerFor( memorySourceFiles: sourceFiles, resolutionInputs: resolutionInputs, - options: [Flags.analyzeOnly]); + options: [Flags.analyzeOnly, Flags.useOldFrontend]); compilerDeserialized.impactCacheDeleter.retainCachesForTesting = true; await compilerDeserialized.run(entryPoint); ElementEnvironment elementEnvironment = diff --git a/tests/compiler/dart2js/serialization/resolved_ast_test.dart b/tests/compiler/dart2js/serialization/resolved_ast_test.dart index 5c7b3a11461..7561f73de5c 100644 --- a/tests/compiler/dart2js/serialization/resolved_ast_test.dart +++ b/tests/compiler/dart2js/serialization/resolved_ast_test.dart @@ -35,15 +35,16 @@ main(List args) { Future check(SerializedData serializedData, Uri entryPoint, [Map sourceFiles = const {}]) async { - Compiler compilerNormal = - compilerFor(memorySourceFiles: sourceFiles, options: [Flags.analyzeAll]); + Compiler compilerNormal = compilerFor( + memorySourceFiles: sourceFiles, + options: [Flags.analyzeAll, Flags.useOldFrontend]); compilerNormal.impactCacheDeleter.retainCachesForTesting = true; await compilerNormal.run(entryPoint); Compiler compilerDeserialized = compilerFor( memorySourceFiles: serializedData.toMemorySourceFiles(sourceFiles), resolutionInputs: serializedData.toUris(), - options: [Flags.analyzeAll]); + options: [Flags.analyzeAll, Flags.useOldFrontend]); compilerDeserialized.impactCacheDeleter.retainCachesForTesting = true; await compilerDeserialized.run(entryPoint); diff --git a/tests/compiler/dart2js/show_package_warnings_test.dart b/tests/compiler/dart2js/show_package_warnings_test.dart index f4e06b97b97..5182eef54ce 100644 --- a/tests/compiler/dart2js/show_package_warnings_test.dart +++ b/tests/compiler/dart2js/show_package_warnings_test.dart @@ -65,6 +65,11 @@ main() { m(null); pkg2.m(null); } +""", + '.packages': """ +pkg_error1:pkg/pkg_error1/ +pkg_error2:pkg/pkg_error2/ +pkg_noerror:pkg/pkg_noerror/ """ }; @@ -90,7 +95,7 @@ Future test(Uri entryPoint, entryPoint: entryPoint, memorySourceFiles: SOURCE, options: options, - packageRoot: Uri.parse('memory:pkg/'), + packageConfig: Uri.parse('memory:.packages'), diagnosticHandler: collector); Expect.equals( 0, collector.errors.length, 'Unexpected errors: ${collector.errors}'); diff --git a/tests/compiler/dart2js/sourcemaps/d2js_validity_test.dart b/tests/compiler/dart2js/sourcemaps/d2js_validity_test.dart index 006c5947379..53e0c75c412 100644 --- a/tests/compiler/dart2js/sourcemaps/d2js_validity_test.dart +++ b/tests/compiler/dart2js/sourcemaps/d2js_validity_test.dart @@ -17,8 +17,12 @@ void main() { 'tests/compiler/dart2js/sourcemaps/test_files/validator_test_file.dart'; asyncTest(() => createTempDir().then((Directory tmpDir) { print('Compiling $mainFile'); - Future result = entry.internalMain( - [mainFile, '-o${tmpDir.path}/out.js', '--library-root=sdk']); + Future result = entry.internalMain([ + mainFile, + '-o${tmpDir.path}/out.js', + '--library-root=sdk', + '--use-old-frontend' + ]); return result.then((CompilationResult result) { CompilerImpl compiler = result.compiler; Uri uri = new Uri.file('${tmpDir.path}/out.js', diff --git a/tests/compiler/dart2js/sourcemaps/deferred_d2js_validity_test.dart b/tests/compiler/dart2js/sourcemaps/deferred_d2js_validity_test.dart index 8d1ff284921..ac03ca17f95 100644 --- a/tests/compiler/dart2js/sourcemaps/deferred_d2js_validity_test.dart +++ b/tests/compiler/dart2js/sourcemaps/deferred_d2js_validity_test.dart @@ -16,8 +16,12 @@ void main() { String file = 'tests/compiler/dart2js/sourcemaps/test_files/' 'deferred_validator_test_file.dart'; print("Compiling $file"); - var result = entry.internalMain( - [file, '-o${tmpDir.path}/out.js', '--library-root=sdk']); + var result = entry.internalMain([ + file, + '-o${tmpDir.path}/out.js', + '--library-root=sdk', + '--use-old-frontend' + ]); return result.then((CompilationResult result) { CompilerImpl compiler = result.compiler; Uri mainUri = new Uri.file('${tmpDir.path}/out.js', diff --git a/tests/compiler/dart2js/sourcemaps/mapping_test.dart b/tests/compiler/dart2js/sourcemaps/mapping_test.dart index 5a84b3f6d22..ffc05cadd82 100644 --- a/tests/compiler/dart2js/sourcemaps/mapping_test.dart +++ b/tests/compiler/dart2js/sourcemaps/mapping_test.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:async_helper/async_helper.dart'; import 'package:compiler/compiler_new.dart'; -import 'package:compiler/src/commandline_options.dart'; import 'package:expect/expect.dart'; import 'package:source_maps/source_maps.dart'; import 'package:sourcemap_testing/src/annotated_code_helper.dart'; @@ -21,7 +20,7 @@ const List TESTS = const [ ''', ''' @{main}main() { - @{+main}throw ''; + @{main}throw ''; @{main}} ''', ''' @@ -49,22 +48,11 @@ class Test { Test(this.annotatedCode, this.code, this.expectedLocations); } -Test processTestCode(String code, {bool useNewSourceInfo}) { +Test processTestCode(String code) { List expectedLocations = []; AnnotatedCode annotatedCode = new AnnotatedCode.fromText(code); for (Annotation annotation in annotatedCode.annotations) { - String methodName; - if (annotation.text.startsWith('-')) { - // Expect only in old source maps - if (useNewSourceInfo) continue; - methodName = annotation.text.substring(1); - } else if (annotation.text.startsWith('+')) { - // Expect only in new source maps - if (!useNewSourceInfo) continue; - methodName = annotation.text.substring(1); - } else { - methodName = annotation.text; - } + String methodName = annotation.text; expectedLocations.add( new SourceLocation(methodName, annotation.lineNo, annotation.columnNo)); } @@ -87,7 +75,7 @@ void main(List arguments) { int index = int.parse(arg, onError: (_) => null); if (index != null) { indices ??= []; - if (index < 0 || index >= TESTS.length * 2) { + if (index < 0 || index >= TESTS.length) { print('Index $index out of bounds: [0;${TESTS.length - 1}]'); } else { indices.add(index); @@ -96,36 +84,22 @@ void main(List arguments) { } } if (indices == null) { - indices = new List.generate(TESTS.length * 2, (i) => i); + indices = new List.generate(TESTS.length, (i) => i); } asyncTest(() async { for (int index in indices) { - bool useNewSourceInfo = index % 2 == 1; - await runTest( - index, - processTestCode(TESTS[index ~/ 2], - useNewSourceInfo: useNewSourceInfo), - printJs: printJs, - writeJs: writeJs, - verbose: verbose, - useNewSourceInfo: useNewSourceInfo); + await runTest(index, processTestCode(TESTS[index]), + printJs: printJs, writeJs: writeJs, verbose: verbose); } }); } Future runTest(int index, Test test, - {bool printJs: false, - bool writeJs, - bool verbose: false, - bool useNewSourceInfo: false}) async { + {bool printJs: false, bool writeJs, bool verbose: false}) async { print("--$index------------------------------------------------------------"); - print("Compiling dart2js ${useNewSourceInfo ? Flags.useNewSourceInfo : ''}\n" - "${test.annotatedCode}"); + print("Compiling dart2js\n ${test.annotatedCode}"); OutputCollector collector = new OutputCollector(); List options = ['--out=out.js', '--source-map=out.js.map']; - if (useNewSourceInfo) { - options.add(Flags.useNewSourceInfo); - } CompilationResult compilationResult = await runCompiler( entryPoint: Uri.parse('memory:main.dart'), memorySourceFiles: {'main.dart': test.code}, diff --git a/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart index 1627c85ff06..a1c654c50db 100644 --- a/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart +++ b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart @@ -11,17 +11,23 @@ import '../memory_compiler.dart'; main() { asyncTest(() async { - String oldMap = (await compile([])).getOutput('', OutputType.sourceMap); - String newMap = (await compile([Flags.useNewSourceInfo])) + String oldMap = (await compile([Flags.useOldFrontend])) .getOutput('', OutputType.sourceMap); - OutputCollector multiCollector1 = await compile([Flags.useMultiSourceInfo]); + String newMap = + (await compile([Flags.useOldFrontend, Flags.useNewSourceInfo])) + .getOutput('', OutputType.sourceMap); + OutputCollector multiCollector1 = + await compile([Flags.useOldFrontend, Flags.useMultiSourceInfo]); String multiMap1a = multiCollector1.getOutput('', OutputType.sourceMap); String multiMap1b = multiCollector1.getOutput('out.js', OutputType.sourceMap); Expect.equals(oldMap, multiMap1a); Expect.equals(newMap, multiMap1b); - OutputCollector multiCollector2 = - await compile([Flags.useMultiSourceInfo, Flags.useNewSourceInfo]); + OutputCollector multiCollector2 = await compile([ + Flags.useOldFrontend, + Flags.useMultiSourceInfo, + Flags.useNewSourceInfo + ]); String multiMap2a = multiCollector2.getOutput('', OutputType.sourceMap); String multiMap2b = multiCollector2.getOutput('out.js', OutputType.sourceMap); diff --git a/tests/compiler/dart2js/sourcemaps/name_test.dart b/tests/compiler/dart2js/sourcemaps/name_test.dart index d49387e046b..4855843efbc 100644 --- a/tests/compiler/dart2js/sourcemaps/name_test.dart +++ b/tests/compiler/dart2js/sourcemaps/name_test.dart @@ -7,7 +7,7 @@ library source_map_name_test; import 'package:async_helper/async_helper.dart'; import 'package:expect/expect.dart'; import 'package:compiler/src/compiler.dart'; -import 'package:compiler/src/elements/elements.dart'; +import 'package:compiler/src/elements/entities.dart'; import 'package:compiler/src/io/source_information.dart'; import '../memory_compiler.dart'; @@ -71,7 +71,7 @@ main() { } '''; -check(Element element, String expectedName) { +check(Entity element, String expectedName) { String name = computeElementNameForSourceMaps(element); Expect.equals(expectedName, name, "Unexpected name '$name' for $element, expected '$expectedName'."); @@ -82,19 +82,23 @@ main() { CompilationResult result = await runCompiler(memorySourceFiles: {'main.dart': SOURCE}); Compiler compiler = result.compiler; - LibraryElement mainApp = - compiler.frontendStrategy.elementEnvironment.mainLibrary; + var env = compiler.backendClosedWorldForTesting.elementEnvironment; + LibraryEntity mainApp = env.mainLibrary; - Element lookup(String name) { - Element element; + Entity lookup(String name) { + Entity element; int dotPosition = name.indexOf('.'); if (dotPosition != -1) { String clsName = name.substring(0, dotPosition); - ClassElement cls = mainApp.find(clsName); + ClassEntity cls = env.lookupClass(mainApp, clsName); Expect.isNotNull(cls, "Class '$clsName' not found."); - element = cls.localLookup(name.substring(dotPosition + 1)); + var subname = name.substring(dotPosition + 1); + element = env.lookupLocalClassMember(cls, subname) ?? + env.lookupConstructor(cls, subname); + } else if (name.substring(0, 1) == name.substring(0, 1).toUpperCase()) { + element = env.lookupClass(mainApp, name); } else { - element = mainApp.find(name); + element = env.lookupLibraryMember(mainApp, name); } Expect.isNotNull(element, "Element '$name' not found."); return element; @@ -107,51 +111,50 @@ main() { } dynamic element = lookup(lookupName); check(element, expectedName); - if (element.isConstructor) { - var constructorBody = - element.enclosingClass.lookupConstructorBody(element.name); - Expect.isNotNull( - element, "Constructor body '${element.name}' not found."); - check(constructorBody, expectedName); + if (element is ConstructorEntity) { + env.forEachConstructorBody(element.enclosingClass, (body) { + if (body.name != element.name) return; + Expect.isNotNull( + body, "Constructor body '${element.name}' not found."); + check(body, expectedName); + }); } if (expectedClosureNames != null) { int index = 0; - for (var closure in element.nestedClosures) { + env.forEachNestedClosure(element, (closure) { String expectedName = expectedClosureNames[index]; check(closure, expectedName); - check(closure.expression, expectedName); check(closure.enclosingClass, expectedName); index++; - } + }); } } checkName('toplevelField'); checkName('toplevelMethod'); - checkName('toplevelAnonymous', ['toplevelAnonymous.']); - checkName('toplevelLocal', ['toplevelLocal.localMethod']); + // TODO(johnniwinther): improve closure names. + checkName('toplevelAnonymous', ['toplevelAnonymous_closure']); + checkName('toplevelLocal', ['toplevelLocal_localMethod']); checkName('Class'); checkName('main'); checkName('Class.staticField'); checkName('Class.staticMethod'); - checkName('Class.staticAnonymous', - ['Class.staticAnonymous.']); - checkName('Class.staticLocal', ['Class.staticLocal.localMethod']); + checkName('Class.staticAnonymous', ['Class_staticAnonymous_closure']); + checkName('Class.staticLocal', ['Class_staticLocal_localMethod']); - checkName('Class', ['Class.'], 'Class.'); - checkName('Class.named', ['Class.named.localMethod']); + checkName('Class', ['Class_closure'], 'Class.'); + checkName('Class.named', ['Class\$named_localMethod']); checkName('Class.instanceField'); checkName('Class.instanceMethod'); - checkName('Class.instanceAnonymous', - ['Class.instanceAnonymous.']); - checkName('Class.instanceLocal', ['Class.instanceLocal.localMethod']); + checkName('Class.instanceAnonymous', ['Class_instanceAnonymous_closure']); + checkName('Class.instanceLocal', ['Class_instanceLocal_localMethod']); checkName('Class.instanceNestedLocal', [ - 'Class.instanceNestedLocal.localMethod', - 'Class.instanceNestedLocal.localMethod.', - 'Class.instanceNestedLocal.localMethod.nestedLocalMethod' + 'Class_instanceNestedLocal_localMethod', + 'Class_instanceNestedLocal_localMethod_closure', + 'Class_instanceNestedLocal_localMethod_nestedLocalMethod' ]); }); } diff --git a/tests/compiler/dart2js/sourcemaps/pub_build_validity_test.dart b/tests/compiler/dart2js/sourcemaps/pub_build_validity_test.dart index 8804cdbb669..6783b331f8d 100644 --- a/tests/compiler/dart2js/sourcemaps/pub_build_validity_test.dart +++ b/tests/compiler/dart2js/sourcemaps/pub_build_validity_test.dart @@ -19,8 +19,9 @@ void main() { print("Copying '${sunflowerDir.path}' to '${tmpDir.path}'."); copyDirectory(sunflowerDir, tmpDir); String ext = Platform.isWindows ? '.bat' : ''; - String command = path.normalize(path.join( - path.fromUri(Platform.script), '../../../../../sdk/bin/pub${ext}')); + String command = path.fromUri(Uri + .parse(Platform.resolvedExecutable) + .resolve('dart-sdk/bin/pub${ext}')); String file = path.join(tmpDir.path, 'build/web/sunflower.dart.js'); // sunflower/pubspec.yaml only depends on package:browser for Dartium, we diff --git a/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart index 76ed3de2884..bf86d5da6dd 100644 --- a/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart +++ b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart @@ -82,8 +82,8 @@ Future runTest(Test test, String config, Flags.useNewSourceInfo, input, ]..addAll(options); - if (config == kernelMarker) { - arguments.add(Flags.useKernel); + if (config == astMarker) { + arguments.add(Flags.useOldFrontend); } print("Compiling dart2js ${arguments.join(' ')}"); CompilationResult compilationResult = await entry.internalMain(arguments); diff --git a/tests/compiler/dart2js/sourcemaps/stepping_test.dart b/tests/compiler/dart2js/sourcemaps/stepping_test.dart index a0bf75efb51..4738bbcddc2 100644 --- a/tests/compiler/dart2js/sourcemaps/stepping_test.dart +++ b/tests/compiler/dart2js/sourcemaps/stepping_test.dart @@ -75,9 +75,8 @@ Future runTest(AnnotatedCode annotatedCode, String config, inputFile, Flags.disableInlining, ]; - if (config == kernelMarker) { - arguments.add(Flags.useKernel); - } else { + if (config == astMarker) { + arguments.add(Flags.useOldFrontend); arguments.add(Flags.useNewSourceInfo); } CompilationResult compilationResult = await entry.internalMain(arguments); diff --git a/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart b/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart index f1c2423d026..781b46bc9a6 100644 --- a/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart +++ b/tests/compiler/dart2js/sourcemaps/tools/source_mapping_tester.dart @@ -133,11 +133,12 @@ bool parseArgument(String argument, Set configurations, const Map> TEST_CONFIGURATIONS = const { 'ast': const [ '--use-new-source-info', + '--use-old-frontend', ], - 'kernel': const [ - Flags.useKernel, + 'kernel': const [], + 'old': const [ + '--use-old-frontend', ], - 'old': const [], }; final Map TEST_FILES = _computeTestFiles(); diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart index e4f6b26b70c..f515c66f91d 100644 --- a/tests/compiler/dart2js/type_test_helper.dart +++ b/tests/compiler/dart2js/type_test_helper.dart @@ -105,8 +105,9 @@ class TypeEnvironment { memorySourceFiles: {'main.dart': source}, diagnosticHandler: collector, options: stopAfterTypeInference - ? options - : ([Flags.analyzeAll, Flags.analyzeOnly]..addAll(options)), + ? ([Flags.useOldFrontend]..addAll(options)) + : ([Flags.useOldFrontend, Flags.analyzeAll, Flags.analyzeOnly] + ..addAll(options)), beforeRun: (compiler) { compiler.stopAfterTypeInference = stopAfterTypeInference; }); diff --git a/tests/compiler/dart2js/uri_retention_test.dart b/tests/compiler/dart2js/uri_retention_test.dart index dc7d70f0086..43bd12b3d36 100644 --- a/tests/compiler/dart2js/uri_retention_test.dart +++ b/tests/compiler/dart2js/uri_retention_test.dart @@ -17,7 +17,7 @@ Future compileSources(sources, var options = []; if (minify) options.add(Flags.minify); if (preserveUri) options.add(Flags.preserveUris); - if (useKernel) options.add(Flags.useKernel); + if (!useKernel) options.add(Flags.useOldFrontend); OutputCollector outputCollector = new OutputCollector(); await runCompiler( memorySourceFiles: sources, diff --git a/tests/compiler/dart2js/user_crash_test.dart b/tests/compiler/dart2js/user_crash_test.dart index 8d46c4b8d6b..250f4cb83bc 100644 --- a/tests/compiler/dart2js/user_crash_test.dart +++ b/tests/compiler/dart2js/user_crash_test.dart @@ -100,7 +100,7 @@ Future run( memorySourceFiles: memorySourceFiles, diagnosticHandler: diagnostics, packagesDiscoveryProvider: packagesDiscoveryProvider, - options: useKernel ? [Flags.useKernel] : []); + options: useKernel ? [] : [Flags.useOldFrontend]); } catch (e) { result.exceptions.add(e); } diff --git a/tests/compiler/dart2js/zero_termination_test.dart b/tests/compiler/dart2js/zero_termination_test.dart index f2c11cd77ce..4a49e8cbcb2 100644 --- a/tests/compiler/dart2js/zero_termination_test.dart +++ b/tests/compiler/dart2js/zero_termination_test.dart @@ -65,7 +65,7 @@ Future testFile({bool useKernel}) async { String inFilePath = pathOfData.resolve('data/one_line_dart_program.dart').path; List args = [inFilePath, "--out=" + outFilePath]; - if (useKernel) args.add(Flags.useKernel); + if (!useKernel) args.add(Flags.useOldFrontend); await cleanup(); check(await launchDart2Js(args, noStdoutEncoding: true)); @@ -76,7 +76,7 @@ Future serverRunning(HttpServer server, {bool useKernel}) async { int port = server.port; String inFilePath = "http://127.0.0.1:$port/data/one_line_dart_program.dart"; List args = [inFilePath, "--out=" + outFilePath]; - if (useKernel) args.add(Flags.useKernel); + if (!useKernel) args.add(Flags.useOldFrontend); server.listen(handleRequest); try { diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status index 0eded1d28c8..b011ab8b743 100644 --- a/tests/compiler/dart2js_extra/dart2js_extra.status +++ b/tests/compiler/dart2js_extra/dart2js_extra.status @@ -13,9 +13,6 @@ no_such_method_test: Fail # Wrong Invocation.memberName. statements_test: Fail typed_locals_test: Pass, Fail -[ $compiler == dart2js && !$checked ] -closure_signature_unneeded_test: RuntimeError # Too eager signature generation. - [ $compiler != dart2js ] dummy_compiler_test: SkipByDesign # Issue 30773. Test should be migrated as a unit test of dart2js, is only intended to test self-hosting. @@ -91,6 +88,9 @@ mirrors_used_warning2_test: Crash mirrors_used_warning_test/minif: Crash mirrors_used_warning_test/none: Crash +[ $compiler == dart2js && !$checked ] +closure_signature_unneeded_test: RuntimeError # Too eager signature generation. + [ $compiler == dart2js && $csp ] deferred_custom_loader_test: SkipByDesign # Issue 25683 deferred_fail_and_retry_test: SkipByDesign # Uses eval to simulate failed loading. @@ -198,7 +198,7 @@ string_interpolation_dynamic_test: Fail # CRLF handling clarified, see Issue 235 string_interpolation_test: Fail # CRLF handling clarified, see Issue 23562 [ $compiler == dart2js && !$host_checked ] -dummy_compiler_test: Slow, Pass +dummy_compiler_test: RuntimeError, Slow # Issue 32439. self-hosting doesn't work with CFE yet. [ $compiler == dart2js && $minified ] code_motion_exception_test: Skip # Requires unminified operator names. diff --git a/tools/testing/dart/configuration.dart b/tools/testing/dart/configuration.dart index ed470868aa4..a98de9ea2f1 100644 --- a/tools/testing/dart/configuration.dart +++ b/tools/testing/dart/configuration.dart @@ -191,7 +191,7 @@ class Configuration { Compiler.fasta, ]; return fastaCompilers.contains(compiler) || - compiler == Compiler.dart2js && useDart2JSWithKernel; + compiler == Compiler.dart2js && !useDart2JSOldFrontend; } /// Returns true if this configuration is considered Dart 2.0 configuration