Reviewers: William Hesse,

Message:
Follow-up to http://codereview.chromium.org/7828072/

Please take a look.

Description:
Limit the time d8 interactive shell's input strings stay alive.


Please review this at http://codereview.chromium.org/7779032/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/d8.cc


Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 729ce88bbc948a0a8b89c792b3870d872821368c..55f1c764028d204a63fc54f5502c5a6fd0390102 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -864,7 +864,7 @@ Handle<String> Shell::ReadFile(const char* name) {
 void Shell::RunShell() {
   Locker locker;
   Context::Scope context_scope(evaluation_context_);
-  HandleScope handle_scope;
+  HandleScope outer_scope;
   Handle<String> name = String::New("(d8)");
 #ifndef V8_SHARED
   LineEditor* editor = LineEditor::Get();
@@ -877,6 +877,7 @@ void Shell::RunShell() {
     i::SmartPointer<char> input = editor->Prompt(Shell::kPrompt);
     if (input.is_empty()) break;
     editor->AddHistory(*input);
+    HandleScope inner_scope;
     ExecuteString(String::New(*input), name, true, true);
   }
   editor->Close();
@@ -887,6 +888,7 @@ void Shell::RunShell() {
     char buffer[kBufferSize];
     printf("%s", Shell::kPrompt);
     if (fgets(buffer, kBufferSize, stdin) == NULL) break;
+    HandleScope inner_scope;
     ExecuteString(String::New(buffer), name, true, true);
   }
 #endif  // V8_SHARED


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to