mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00

Try to print JavaScript stack on fatal error. OOMError needs to be distinguished from fatal error since no new handle can be created at that time. PR-URL: https://github.com/nodejs/node/pull/44242 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
23 lines
506 B
C++
23 lines
506 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
using v8::FunctionCallbackInfo;
|
|
using v8::Isolate;
|
|
using v8::Local;
|
|
using v8::MaybeLocal;
|
|
using v8::Object;
|
|
using v8::Value;
|
|
|
|
void TriggerFatalError(const FunctionCallbackInfo<Value>& args) {
|
|
Isolate* isolate = args.GetIsolate();
|
|
|
|
// Trigger a v8 ApiCheck failure.
|
|
MaybeLocal<Value> value;
|
|
value.ToLocalChecked();
|
|
}
|
|
|
|
void init(Local<Object> exports) {
|
|
NODE_SET_METHOD(exports, "triggerFatalError", TriggerFatalError);
|
|
}
|
|
|
|
NODE_MODULE(NODE_GYP_MODULE_NAME, init)
|