Skip to content

Commit 1c79c3f

Browse files
natebiggsCommit Queue
authored andcommitted
Plumb extra 'requireMain' flag through kernel builder entry point.
This is the method used by dart2wasm to generate a kernel from a source URI. For dynamic modules, the source will, by design, not include a 'main' function. Without this flag the CFE will exit early with an error while compiling the source. Change-Id: I1b66f7c0052ead80f5e555555d19a1b8a0cb590f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400920 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Nate Biggs <[email protected]>
1 parent 652794d commit 1c79c3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/front_end/lib/src/api_prototype/kernel_generator.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ import 'compiler_options.dart' show CompilerOptions;
4242
/// an error is reported.
4343
// TODO(sigmund): rename to kernelForScript?
4444
Future<CompilerResult?> kernelForProgram(Uri source, CompilerOptions options,
45-
{List<Uri> additionalSources = const <Uri>[]}) async {
45+
{List<Uri> additionalSources = const <Uri>[],
46+
bool requireMain = true}) async {
4647
return (await kernelForProgramInternal(source, options,
47-
additionalSources: additionalSources));
48+
additionalSources: additionalSources, requireMain: requireMain));
4849
}
4950

5051
// Coverage-ignore(suite): Not run.

0 commit comments

Comments
 (0)