Commit 29e3ae8d authored by ager@chromium.org's avatar ager@chromium.org

Make sure that the d8 shell calls OnExit in case of exceptions.

Review URL: http://codereview.chromium.org/42415

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 30f49d60
......@@ -586,8 +586,10 @@ int Shell::Main(int argc, char* argv[]) {
v8::HandleScope handle_scope;
v8::Handle<v8::String> file_name = v8::String::New("unnamed");
v8::Handle<v8::String> source = v8::String::New(argv[i + 1]);
if (!ExecuteString(source, file_name, false, true))
if (!ExecuteString(source, file_name, false, true)) {
OnExit();
return 1;
}
i++;
} else if (strcmp(str, "-p") == 0 && i + 1 < argc) {
int size = 0;
......@@ -607,8 +609,10 @@ int Shell::Main(int argc, char* argv[]) {
printf("Error reading '%s'\n", str);
return 1;
}
if (!ExecuteString(source, file_name, false, true))
if (!ExecuteString(source, file_name, false, true)) {
OnExit();
return 1;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment