Catch graceful failures when deserializing in d8.

R=vogelheim@chromium.org

Review URL: https://codereview.chromium.org/917653002

Cr-Commit-Position: refs/heads/master@{#26579}
This commit is contained in:
yangguo 2015-02-11 06:10:02 -08:00 committed by Commit bot
parent 5d1a9b09f3
commit 505b6020a8

View File

@ -249,10 +249,13 @@ Local<Script> Shell::CompileString(
DCHECK(false); // A new compile option?
}
if (data == NULL) compile_options = ScriptCompiler::kNoCompileOptions;
return source_type == SCRIPT
? ScriptCompiler::Compile(isolate, &cached_source, compile_options)
: ScriptCompiler::CompileModule(isolate, &cached_source,
compile_options);
Local<Script> result =
source_type == SCRIPT
? ScriptCompiler::Compile(isolate, &cached_source, compile_options)
: ScriptCompiler::CompileModule(isolate, &cached_source,
compile_options);
CHECK(data == NULL || !data->rejected);
return result;
}