Skip to content

Commit e40618d

Browse files
fishythefishCommit Queue
authored andcommitted
[dart2js] Report error when input file is not .dart or .dill
Bug: #61361 Change-Id: I499c4c3818804b48fdb043860d4c7aabb4ffd6db Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446685 Reviewed-by: Nate Biggs <[email protected]> Commit-Queue: Mayank Patke <[email protected]>
1 parent 2fcfdd7 commit e40618d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/compiler/lib/src/dart2js.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,14 @@ Future<api.CompilationResult> compile(
674674
if (sourceOrDill.endsWith('.dart')) {
675675
options.add('${Flags.entryUri}=$file');
676676
entryUri = file;
677-
} else {
678-
assert(sourceOrDill.endsWith('.dill'));
677+
} else if (sourceOrDill.endsWith('.dill')) {
679678
options.add('${Flags.inputDill}=$file');
680679
inputDillUri = file;
680+
} else {
681+
_fail(
682+
"Unexpected file '$sourceOrDill'.\n"
683+
"Only .dart and .dill extensions are supported.",
684+
);
681685
}
682686
}
683687

0 commit comments

Comments
 (0)