Skip to content

Commit c040cd6

Browse files
nshahanCommit Queue
authored andcommitted
[ddc] Pass an empty array when running main
Match the behavior of the ddc module system when running the applications main method when using the new library bundle format. This passes an empty JavaScript array to the main method which is good enough to get the benchmarks that use main method args to run. The API should be updated in a way that allows you to actually pass a JavaScript array of Strings when starting the program. Issue: #35113 Change-Id: I1a9aeb1df7afa5948d7f23517b3ac913aaabb62c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408640 Reviewed-by: Nate Biggs <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent e3d809f commit c040cd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/dev_compiler/lib/js/ddc/ddc_module_loader.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,8 @@ if (!self.deferred_loader) {
15161516
let entryPointLibrary = this.initializeAndLinkLibrary(entryPointLibraryName);
15171517
this.savedEntryPointLibraryName = entryPointLibraryName;
15181518
this.savedDartSdkRuntimeOptions = dartSdkRuntimeOptions;
1519-
entryPointLibrary.main();
1519+
// TODO(35113): Provide the ability to pass arguments in a type safe way.
1520+
entryPointLibrary.main([]);
15201521
}
15211522

15221523
setDartSDKRuntimeOptions(options) {
@@ -1635,7 +1636,8 @@ if (!self.deferred_loader) {
16351636
console.log('Hot restarting application from main method in: ' +
16361637
this.savedEntryPointLibraryName + ' (generation: ' +
16371638
this.hotRestartGeneration + ').');
1638-
entryPointLibrary.main();
1639+
// TODO(35113): Provide the ability to pass arguments in a type safe way.
1640+
entryPointLibrary.main([]);
16391641
}
16401642
}
16411643

0 commit comments

Comments
 (0)