We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
node_messaging.cc
1 parent 96b2bfb commit 185d1ffCopy full SHA for 185d1ff
src/node_messaging.cc
@@ -1627,10 +1627,15 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
1627
1628
MessagePort::Entangle(port1, port2);
1629
1630
- args.This()->Set(context, env->port1_string(), port1->object())
1631
- .Check();
1632
- args.This()->Set(context, env->port2_string(), port2->object())
1633
+ if (args.This()
+ ->Set(context, env->port1_string(), port1->object())
+ .IsNothing() ||
+ args.This()
1634
+ ->Set(context, env->port2_string(), port2->object())
1635
+ .IsNothing()) {
1636
+ port1->Close();
1637
+ port2->Close();
1638
+ }
1639
}
1640
1641
static void BroadcastChannel(const FunctionCallbackInfo<Value>& args) {
0 commit comments