mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
src: improve error handling in node_messaging.cc
PR-URL: https://github.com/nodejs/node/pull/57211 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
1 parent
7cfad4c492
commit
32243bbfbe
1 file changed
+9
-4
@@ -1627,10 +1627,15 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
MessagePort::Entangle(port1, port2);
|
||||
|
||||
args.This()->Set(context, env->port1_string(), port1->object())
|
||||
.Check();
|
||||
args.This()->Set(context, env->port2_string(), port2->object())
|
||||
.Check();
|
||||
if (args.This()
|
||||
->Set(context, env->port1_string(), port1->object())
|
||||
.IsNothing() ||
|
||||
args.This()
|
||||
->Set(context, env->port2_string(), port2->object())
|
||||
.IsNothing()) {
|
||||
port1->Close();
|
||||
port2->Close();
|
||||
}
|
||||
}
|
||||
|
||||
static void BroadcastChannel(const FunctionCallbackInfo<Value>& args) {
|
||||
|
||||
Reference in new issue
Block a user