Commit fb1de271 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[interpreter] Make d8's TryCatch block be verbose.

This changes "d8" to no longer report exceptions as being "caught" when
it comes to the catch prediction mechanism in our debugger. This treats
scripts as being truly top-level when it comes to exception handling and
will allow us to properly test the catch prediction mechanism using just
mjsunit tests alone.

R=yangguo@chromium.org
BUG=v8:4674
LOG=n

Review URL: https://codereview.chromium.org/1691723002

Cr-Commit-Position: refs/heads/master@{#33898}
parent 3781ca79
...@@ -375,6 +375,7 @@ bool Shell::ExecuteString(Isolate* isolate, Local<String> source, ...@@ -375,6 +375,7 @@ bool Shell::ExecuteString(Isolate* isolate, Local<String> source,
bool report_exceptions, SourceType source_type) { bool report_exceptions, SourceType source_type) {
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
TryCatch try_catch(isolate); TryCatch try_catch(isolate);
try_catch.SetVerbose(true);
MaybeLocal<Value> maybe_result; MaybeLocal<Value> maybe_result;
{ {
...@@ -1247,6 +1248,10 @@ Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) { ...@@ -1247,6 +1248,10 @@ Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
return global_template; 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) { void Shell::Initialize(Isolate* isolate) {
#ifndef V8_SHARED #ifndef V8_SHARED
...@@ -1254,6 +1259,8 @@ void Shell::Initialize(Isolate* isolate) { ...@@ -1254,6 +1259,8 @@ void Shell::Initialize(Isolate* isolate) {
if (i::StrLength(i::FLAG_map_counters) != 0) if (i::StrLength(i::FLAG_map_counters) != 0)
MapCounters(isolate, i::FLAG_map_counters); MapCounters(isolate, i::FLAG_map_counters);
#endif // !V8_SHARED #endif // !V8_SHARED
// Disable default message reporting.
isolate->AddMessageListener(EmptyMessageCallback);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment