D8 should send idle notification even after the last run.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 May 2014 13:31:55 +0000 (13:31 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 26 May 2014 13:31:55 +0000 (13:31 +0000)
This, in combination with changes to the bot, should weed out false negatives.

R=marja@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/d8.cc

index ffc58e6..b04fa71 100644 (file)
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -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) {
+    if (options.last_run && options.interactive_shell) {
       // Keep using the same context in the interactive shell.
       evaluation_context_.Reset(isolate, context);
 #ifndef V8_SHARED
@@ -1362,12 +1362,10 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) {
       options.isolate_sources[0].Execute(isolate);
     }
   }
-  if (!options.last_run) {
-    if (options.send_idle_notification) {
-      const int kLongIdlePauseInMs = 1000;
-      V8::ContextDisposedNotification();
-      V8::IdleNotification(kLongIdlePauseInMs);
-    }
+  if (options.send_idle_notification) {
+    const int kLongIdlePauseInMs = 1000;
+    V8::ContextDisposedNotification();
+    V8::IdleNotification(kLongIdlePauseInMs);
   }
 
 #ifndef V8_SHARED