Commit c03b9848 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix d8's interactive shell.

R=danno@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7e8678bb
......@@ -1345,7 +1345,7 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) {
{
HandleScope scope(isolate);
Local<Context> context = CreateEvaluationContext(isolate);
if (options.last_run && options.interactive_shell) {
if (options.last_run && options.use_interactive_shell()) {
// Keep using the same context in the interactive shell.
evaluation_context_.Reset(isolate, context);
#ifndef V8_SHARED
......@@ -1524,8 +1524,7 @@ int Shell::Main(int argc, char* argv[]) {
// Run interactive shell if explicitly requested or if no script has been
// executed, but never on --test
if (( options.interactive_shell || !options.script_executed )
&& !options.test_shell ) {
if (options.use_interactive_shell()) {
#ifndef V8_SHARED
if (!i::FLAG_debugger) {
InstallUtilityScript(isolate);
......
......@@ -213,6 +213,10 @@ class ShellOptions {
delete[] isolate_sources;
}
bool use_interactive_shell() {
return (interactive_shell || !script_executed) && !test_shell;
}
bool script_executed;
bool last_run;
bool send_idle_notification;
......
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