Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: only call FatalException if not verbose #12826

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 283
#define V8_PATCH_LEVEL 38
#define V8_PATCH_LEVEL 39

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
5 changes: 5 additions & 0 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -7982,6 +7982,11 @@ class V8_EXPORT TryCatch {
*/
void SetVerbose(bool value);

/**
* Returns true if verbosity is enabled.
*/
bool IsVerbose() const;

/**
* Set whether or not this TryCatch should capture a Message object
* which holds source information about where the exception
Expand Down
4 changes: 4 additions & 0 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,10 @@ void v8::TryCatch::SetVerbose(bool value) {
is_verbose_ = value;
}

bool v8::TryCatch::IsVerbose() const {
return is_verbose_;
}


void v8::TryCatch::SetCaptureMessage(bool value) {
capture_message_ = value;
Expand Down
6 changes: 3 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2648,9 +2648,9 @@ void FatalException(Isolate* isolate,

void FatalException(Isolate* isolate, const TryCatch& try_catch) {
HandleScope scope(isolate);
// TODO(bajtos) do not call FatalException if try_catch is verbose
// (requires V8 API to expose getter for try_catch.is_verbose_)
FatalException(isolate, try_catch.Exception(), try_catch.Message());
if (!try_catch.IsVerbose()) {
FatalException(isolate, try_catch.Exception(), try_catch.Message());
}
}


Expand Down