Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: utils/kernel-service/kernel-service.dart

Issue 2948273002: Correctly set root_library based on the application script URI instead of looking for the library t… (Closed)
Patch Set: Integrate cl from Siggi for front end change to not require a 'main' method when using the memory f… Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/language_kernel.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/kernel-service/kernel-service.dart
diff --git a/utils/kernel-service/kernel-service.dart b/utils/kernel-service/kernel-service.dart
index 5b7ca5031c378a729bd9740d5777ef6e21fe4d27..f339296645bc2d43c5506c38b997b7c1737235a1 100644
--- a/utils/kernel-service/kernel-service.dart
+++ b/utils/kernel-service/kernel-service.dart
@@ -48,9 +48,13 @@ Future _processLoadRequest(request) async {
final String inputFileUri = request[2];
final Uri script = Uri.base.resolve(inputFileUri);
- FileSystem fileSystem = request.length > 3
- ? _buildFileSystem(request[3])
- : PhysicalFileSystem.instance;
+ FileSystem fileSystem = PhysicalFileSystem.instance;
+ bool requireMain = true;
+
+ if (request.length > 3) {
+ fileSystem = _buildFileSystem(request[3]);
+ requireMain = false;
+ }
Uri packagesUri = (Platform.packageConfig != null)
? Uri.parse(Platform.packageConfig)
@@ -82,7 +86,10 @@ Future _processLoadRequest(request) async {
CompilationResult result;
try {
- Program program = await kernelForProgram(script, options);
+ Program program = requireMain
+ ? await kernelForProgram(script, options)
+ : await kernelForBuildUnit([script], options..chaseDependencies = true);
+
if (errors.isNotEmpty) {
result = new CompilationResult.errors(errors);
} else {
« no previous file with comments | « tests/language/language_kernel.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698