Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b17163b

Browse filesBrowse files
codebytereaduh95
authored andcommitted
src: allow embedder customization of OOMErrorHandler
PR-URL: #57325 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 17d4074 commit b17163b
Copy full SHA for b17163b

File tree

Expand file treeCollapse file tree

2 files changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎src/api/environment.cc‎

Copy file name to clipboardExpand all lines: src/api/environment.cc
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ void SetIsolateErrorHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
233233
auto* fatal_error_cb = s.fatal_error_callback ?
234234
s.fatal_error_callback : OnFatalError;
235235
isolate->SetFatalErrorHandler(fatal_error_cb);
236-
isolate->SetOOMErrorHandler(OOMErrorHandler);
236+
237+
auto* oom_error_cb =
238+
s.oom_error_callback ? s.oom_error_callback : OOMErrorHandler;
239+
isolate->SetOOMErrorHandler(oom_error_cb);
237240

238241
if ((s.flags & SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK) == 0) {
239242
auto* prepare_stack_trace_cb = s.prepare_stack_trace_callback ?
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ struct IsolateSettings {
483483
v8::Isolate::AbortOnUncaughtExceptionCallback
484484
should_abort_on_uncaught_exception_callback = nullptr;
485485
v8::FatalErrorCallback fatal_error_callback = nullptr;
486+
v8::OOMErrorCallback oom_error_callback = nullptr;
486487
v8::PrepareStackTraceCallback prepare_stack_trace_callback = nullptr;
487488

488489
// Miscellaneous callbacks

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.