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

Unified Diff: src/d8.cc

Issue 1691723002: [interpreter] Make d8's TryCatch block be verbose. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment typo. Created 4 years, 10 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 c58c172640edfd31fe0c2e876c8ab98f739cd869..e35b6a7fbcbe013b830d4f0bea9566f0285d116f 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -375,6 +375,7 @@ bool Shell::ExecuteString(Isolate* isolate, Local<String> source,
bool report_exceptions, SourceType source_type) {
HandleScope handle_scope(isolate);
TryCatch try_catch(isolate);
+ try_catch.SetVerbose(true);
MaybeLocal<Value> maybe_result;
{
@@ -1247,6 +1248,10 @@ Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
return global_template;
}
+static void EmptyMessageCallback(Local<Message> message, Local<Value> error) {
+ // Nothing to be done here, exceptions thrown up to the shell will be reported
+ // separately by {Shell::ReportException} after they are caught.
+}
void Shell::Initialize(Isolate* isolate) {
#ifndef V8_SHARED
@@ -1254,6 +1259,8 @@ void Shell::Initialize(Isolate* isolate) {
if (i::StrLength(i::FLAG_map_counters) != 0)
MapCounters(isolate, i::FLAG_map_counters);
#endif // !V8_SHARED
+ // Disable default message reporting.
+ isolate->AddMessageListener(EmptyMessageCallback);
}
« 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