Fix crash when emitting unhandled error on native EventEmitter
This commit is contained in:
parent
40b94e97e5
commit
aa6b9a5025
1 changed files with 6 additions and 2 deletions
|
@ -20,8 +20,12 @@ v8::Local<v8::Value> CallMethodWithArgs(v8::Isolate* isolate,
|
|||
v8::MicrotasksScope::kRunMicrotasks);
|
||||
// Use node::MakeCallback to call the callback, and it will also run pending
|
||||
// tasks in Node.js.
|
||||
return node::MakeCallback(isolate, obj, method, args->size(), &args->front(),
|
||||
{0, 0}).ToLocalChecked();
|
||||
v8::MaybeLocal<v8::Value> ret = node::MakeCallback(isolate, obj, method, args->size(), &args->front(),
|
||||
{0, 0});
|
||||
if (ret.IsEmpty()) {
|
||||
return v8::Boolean::New(isolate, false);
|
||||
}
|
||||
return ret.ToLocalChecked();
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
|
Loading…
Reference in a new issue