Revision: 9121
Author:   [email protected]
Date:     Fri Sep  2 11:50:24 2011
Log:      Avoid creating shell name every time in shell sample.

[email protected]

Signed-off-by: Thiago Farina <[email protected]>
http://code.google.com/p/v8/source/detail?r=9121

Modified:
 /branches/bleeding_edge/samples/shell.cc

=======================================
--- /branches/bleeding_edge/samples/shell.cc    Fri Aug 19 04:13:26 2011
+++ /branches/bleeding_edge/samples/shell.cc    Fri Sep  2 11:50:24 2011
@@ -250,16 +250,14 @@
   static const int kBufferSize = 256;
   // Enter the execution environment before evaluating any code.
   v8::Context::Scope context_scope(context);
+  v8::Local<v8::String> name(v8::String::New("(shell)"));
   while (true) {
     char buffer[kBufferSize];
     printf("> ");
     char* str = fgets(buffer, kBufferSize, stdin);
     if (str == NULL) break;
     v8::HandleScope handle_scope;
-    ExecuteString(v8::String::New(str),
-                  v8::String::New("(shell)"),
-                  true,
-                  true);
+    ExecuteString(v8::String::New(str), name, true, true);
   }
   printf("\n");
 }

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

Reply via email to