Fix the snapshotter to generate valid precompilation snapshots

R=asiva@google.com

Review URL: https://codereview.chromium.org/1673423004 .
This commit is contained in:
Chinmay Garde 2016-02-09 13:46:32 -08:00
parent 14417a7851
commit 63e836ceae
2 changed files with 9 additions and 1 deletions

View file

@ -50,6 +50,10 @@ config("dart_config") {
defines += ["NDEBUG"]
}
if (is_ios || is_mac) {
defines += ["DART_PRECOMPILER"]
}
cflags = [
"-Werror",
"-Wall",

View file

@ -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);
}
}