From ac068b3cb442f03e2711154be757098492ce1873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20von=20der=20Ahe=CC=81?= Date: Wed, 20 Dec 2017 12:49:28 +0000 Subject: [PATCH] Use options.input if entryPoint is null Change-Id: Ia7ce42d2caa025b0e1a31872f23bd0364d6cf5f7 Reviewed-on: https://dart-review.googlesource.com/30820 Reviewed-by: Jens Johansen --- pkg/front_end/lib/src/fasta/incremental_compiler.dart | 1 + pkg/front_end/test/fasta/incremental_hello_test.dart | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart index 425b5937d43..367d4640ce7 100644 --- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart +++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart @@ -76,6 +76,7 @@ class IncrementalCompiler extends DeprecatedIncrementalKernelGenerator { @override Future computeDelta({Uri entryPoint}) async { ticker.reset(); + entryPoint ??= context.options.inputs.single; return context.runInContext>((CompilerContext c) async { if (platform == null) { UriTranslator uriTranslator = await c.options.getUriTranslator(); diff --git a/pkg/front_end/test/fasta/incremental_hello_test.dart b/pkg/front_end/test/fasta/incremental_hello_test.dart index 54cd6bb8093..df123aa14c1 100644 --- a/pkg/front_end/test/fasta/incremental_hello_test.dart +++ b/pkg/front_end/test/fasta/incremental_hello_test.dart @@ -35,15 +35,15 @@ test() async { ..strongMode = false ..onProblem = problemHandler; + final Uri helloDart = Uri.base.resolve("pkg/front_end/testcases/hello.dart"); + final ProcessedOptions options = - new ProcessedOptions(optionBuilder, false, []); + new ProcessedOptions(optionBuilder, false, [helloDart]); IncrementalCompiler compiler = new IncrementalCompiler(new CompilerContext(options)); - Uri helloDart = Uri.base.resolve("pkg/front_end/testcases/hello.dart"); - - FastaDelta delta = await compiler.computeDelta(entryPoint: helloDart); + FastaDelta delta = await compiler.computeDelta(); // Expect that the new program contains at least the following libraries: // dart:core, dart:async, and hello.dart.