-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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: remove ClearFatalExceptionHandlers()
#17333
Changes from 1 commit
703f474
9ca5ccb
b41845a
64acf54
a2e4472
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,17 @@ void AppendExceptionLine(Environment* env, | |
|
||
NO_RETURN void FatalError(const char* location, const char* message); | ||
|
||
// Like a `TryCatch` but it crashes the process if it did catch an exception. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Perhaps this could rephrased to something like "Like a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also write "exits" instead of "crashes" because the latter suggests segfaults and aborts (in my mind at least.) |
||
class FatalTryCatch : public v8::TryCatch { | ||
public: | ||
explicit FatalTryCatch(Environment* env) | ||
: TryCatch(env->isolate()), env_(env) {} | ||
~FatalTryCatch(); | ||
|
||
private: | ||
Environment* env_; | ||
}; | ||
|
||
void ProcessEmitWarning(Environment* env, const char* fmt, ...); | ||
|
||
void FillStatsArray(double* fields, const uv_stat_t* s); | ||
|
@@ -330,11 +341,6 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | |
uint32_t zero_fill_field_ = 1; // Boolean but exposed as uint32 to JS land. | ||
}; | ||
|
||
// Clear any domain and/or uncaughtException handlers to force the error's | ||
// propagation and shutdown the process. Use this to force the process to exit | ||
// by clearing all callbacks that could handle the error. | ||
void ClearFatalExceptionHandlers(Environment* env); | ||
|
||
namespace Buffer { | ||
v8::MaybeLocal<v8::Object> Copy(Environment* env, const char* data, size_t len); | ||
v8::MaybeLocal<v8::Object> New(Environment* env, size_t size); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
ToLocalChecked()
be used here? It would make the program hard-crash before theFatalTryCatch
got time to terminate the program with error message... right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimothyGu Yeah, you’re right. Updated :)