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

Unified Diff: pkg/kernel/lib/transformations/setup_builtin_library.dart

Issue 2691273002: Use kernel transformation and VmTarget. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/front_end/lib/src/fasta/testing/suite.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/setup_builtin_library.dart
diff --git a/pkg/kernel/lib/transformations/setup_builtin_library.dart b/pkg/kernel/lib/transformations/setup_builtin_library.dart
index c04d05091eec28a044e00bb26479657905bb54aa..3fe2f14ba14a6914945164e67b37faabb2108cb0 100644
--- a/pkg/kernel/lib/transformations/setup_builtin_library.dart
+++ b/pkg/kernel/lib/transformations/setup_builtin_library.dart
@@ -13,8 +13,6 @@ Program transformProgram(Program program,
{String libraryUri: 'dart:_builtin'}) {
Procedure mainMethod = program.mainMethod;
- if (mainMethod == null) return program;
-
Library builtinLibrary;
for (Library library in program.libraries) {
if (library.importUri.toString() == libraryUri) {
@@ -39,9 +37,14 @@ Program transformProgram(Program program,
throw new Exception('Could not find "_getMainClosure" in "$libraryUri"');
}
- var returnMainStatement = new ReturnStatement(new StaticGet(mainMethod));
- getMainClosure.body = returnMainStatement;
- returnMainStatement.parent = getMainClosure;
+ if (mainMethod != null) {
+ var returnMainStatement = new ReturnStatement(new StaticGet(mainMethod));
+ getMainClosure.body = returnMainStatement;
+ returnMainStatement.parent = getMainClosure;
+ } else {
+ // TODO(ahe): This should throw no such method error.
+ getMainClosure.body = null;
+ }
return program;
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/testing/suite.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698