Use options.input if entryPoint is null

Change-Id: Ia7ce42d2caa025b0e1a31872f23bd0364d6cf5f7
Reviewed-on: https://dart-review.googlesource.com/30820
Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
Peter von der Ahé 2017-12-20 12:49:28 +00:00 committed by Peter von der Ahé
parent c41e92de84
commit ac068b3cb4
2 changed files with 5 additions and 4 deletions

View file

@ -76,6 +76,7 @@ class IncrementalCompiler extends DeprecatedIncrementalKernelGenerator {
@override
Future<FastaDelta> computeDelta({Uri entryPoint}) async {
ticker.reset();
entryPoint ??= context.options.inputs.single;
return context.runInContext<Future<FastaDelta>>((CompilerContext c) async {
if (platform == null) {
UriTranslator uriTranslator = await c.options.getUriTranslator();

View file

@ -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.