Index: runtime/bin/gen_snapshot.cc |
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc |
index d783c8572dc7ea8fdd5fdd79e3100334a8f9ac32..af2bdb70bfb3c062a8c4e07c9c6a80752e633448 100644 |
--- a/runtime/bin/gen_snapshot.cc |
+++ b/runtime/bin/gen_snapshot.cc |
@@ -435,7 +435,11 @@ static Dart_Handle LoadSnapshotCreationScript(const char* script_name) { |
if (Dart_IsError(source)) { |
return source; |
} |
- return Dart_LoadLibrary(resolved_script_uri, source, 0, 0); |
+ if (IsSnapshottingForPrecompilation()) { |
+ return Dart_LoadScript(resolved_script_uri, source, 0, 0); |
+ } else { |
+ return Dart_LoadLibrary(resolved_script_uri, source, 0, 0); |
+ } |
} |