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

Side by Side Diff: src/isolate.cc

Issue 2417743004: Add option to print all exceptions (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 #endif 1063 #endif
1064 } 1064 }
1065 1065
1066 1066
1067 Object* Isolate::Throw(Object* exception, MessageLocation* location) { 1067 Object* Isolate::Throw(Object* exception, MessageLocation* location) {
1068 DCHECK(!has_pending_exception()); 1068 DCHECK(!has_pending_exception());
1069 1069
1070 HandleScope scope(this); 1070 HandleScope scope(this);
1071 Handle<Object> exception_handle(exception, this); 1071 Handle<Object> exception_handle(exception, this);
1072 1072
1073 if (FLAG_print_all_exceptions) {
1074 printf("=========================================================\n");
1075 printf("Exception thrown:\n");
1076 exception->Print();
1077 printf("Stack Trace:\n");
1078 PrintStack(stdout);
1079 printf("=========================================================\n");
1080 }
1081
1073 // Determine whether a message needs to be created for the given exception 1082 // Determine whether a message needs to be created for the given exception
1074 // depending on the following criteria: 1083 // depending on the following criteria:
1075 // 1) External v8::TryCatch missing: Always create a message because any 1084 // 1) External v8::TryCatch missing: Always create a message because any
1076 // JavaScript handler for a finally-block might re-throw to top-level. 1085 // JavaScript handler for a finally-block might re-throw to top-level.
1077 // 2) External v8::TryCatch exists: Only create a message if the handler 1086 // 2) External v8::TryCatch exists: Only create a message if the handler
1078 // captures messages or is verbose (which reports despite the catch). 1087 // captures messages or is verbose (which reports despite the catch).
1079 // 3) ReThrow from v8::TryCatch: The message from a previous throw still 1088 // 3) ReThrow from v8::TryCatch: The message from a previous throw still
1080 // exists and we preserve it instead of creating a new message. 1089 // exists and we preserve it instead of creating a new message.
1081 bool requires_message = try_catch_handler() == nullptr || 1090 bool requires_message = try_catch_handler() == nullptr ||
1082 try_catch_handler()->is_verbose_ || 1091 try_catch_handler()->is_verbose_ ||
(...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after
3456 // Then check whether this scope intercepts. 3465 // Then check whether this scope intercepts.
3457 if ((flag & intercept_mask_)) { 3466 if ((flag & intercept_mask_)) {
3458 intercepted_flags_ |= flag; 3467 intercepted_flags_ |= flag;
3459 return true; 3468 return true;
3460 } 3469 }
3461 return false; 3470 return false;
3462 } 3471 }
3463 3472
3464 } // namespace internal 3473 } // namespace internal
3465 } // namespace v8 3474 } // namespace v8
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698