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

Unified Diff: src/d8.cc

Issue 25277003: Remove obsolete preparser binary and tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Preserve test suite. Created 7 years, 2 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 | « src/d8.h ('k') | src/preparser-api.cc » ('j') | 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 6eb7248b0e8fa0d84b802f59132cf29c1931d0c6..96407a897c98b1284a3f9b1dd78bb457c5b08bd7 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1231,6 +1231,7 @@ SourceGroup::~SourceGroup() {
void SourceGroup::Execute(Isolate* isolate) {
+ bool exception_was_thrown = false;
for (int i = begin_offset_; i < end_offset_; ++i) {
const char* arg = argv_[i];
if (strcmp(arg, "-e") == 0 && i + 1 < end_offset_) {
@@ -1239,7 +1240,8 @@ void SourceGroup::Execute(Isolate* isolate) {
Handle<String> file_name = String::New("unnamed");
Handle<String> source = String::New(argv_[i + 1]);
if (!Shell::ExecuteString(isolate, source, file_name, false, true)) {
- Shell::Exit(1);
+ exception_was_thrown = true;
+ break;
}
++i;
} else if (arg[0] == '-') {
@@ -1254,10 +1256,14 @@ void SourceGroup::Execute(Isolate* isolate) {
Shell::Exit(1);
}
if (!Shell::ExecuteString(isolate, source, file_name, false, true)) {
- Shell::Exit(1);
+ exception_was_thrown = true;
+ break;
}
}
}
+ if (exception_was_thrown != Shell::options.expected_to_throw) {
+ Shell::Exit(1);
+ }
}
@@ -1413,6 +1419,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
options.dump_heap_constants = true;
argv[i] = NULL;
#endif
+ } else if (strcmp(argv[i], "--throws") == 0) {
+ options.expected_to_throw = true;
+ argv[i] = NULL;
}
#ifdef V8_SHARED
else if (strcmp(argv[i], "--dump-counters") == 0) {
« no previous file with comments | « src/d8.h ('k') | src/preparser-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698