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

Unified Diff: src/d8.cc

Issue 7193011: d8 drops into a shell if no files are passed on command line (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 5a5238011aea88af32d8506d90d1fb3060bd1174..d527315f4cfabae98861adb015012122341ccc12 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1,4 +1,4 @@
-// Copyright 2009 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -921,7 +921,7 @@ int Shell::Main(int argc, char* argv[]) {
// optimization in the last run.
bool FLAG_stress_opt = false;
bool FLAG_stress_deopt = false;
- bool run_shell = (argc == 1);
+ bool FLAG_run_shell = false;
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--stress-opt") == 0) {
@@ -935,13 +935,17 @@ int Shell::Main(int argc, char* argv[]) {
FLAG_stress_opt = false;
FLAG_stress_deopt = false;
} else if (strcmp(argv[i], "--shell") == 0) {
- run_shell = true;
+ FLAG_run_shell = true;
argv[i] = NULL;
}
}
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
+ // Allow SetFlagsFromCommandLine to decrement argc before deciding to
+ // run the shell or not.
+ bool run_shell = FLAG_run_shell || (argc == 1);
+
Initialize();
int result = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698