Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: samples/shell.cc

Issue 4081: Various test-related changes. (Closed)
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/bugs/bug-86.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/shell.cc
diff --git a/samples/shell.cc b/samples/shell.cc
index eecd2b00689c55ab082e9963b7ca117725d337c3..020941025fa4bf03f62f75ca0ca19371ee193545 100644
--- a/samples/shell.cc
+++ b/samples/shell.cc
@@ -73,6 +73,14 @@ int main(int argc, char* argv[]) {
continue;
} else if (strncmp(str, "--", 2) == 0) {
printf("Warning: unknown flag %s.\n", str);
+ } else if (strcmp(str, "-e") == 0 && i + 1 < argc) {
+ // Execute argument given to -e option directly
+ 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))
+ return 1;
+ i++;
} else {
// Use all other arguments as names of files to load and run.
v8::HandleScope handle_scope;
« no previous file with comments | « no previous file | test/mjsunit/bugs/bug-86.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698