diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 72f92b78dbf451..a1f28d4746d07f 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -840,11 +840,11 @@ BaseObjectPtr MessagePortData::Deserialize( } Maybe MessagePort::PostMessage(Environment* env, + Local context, Local message_v, const TransferList& transfer_v) { Isolate* isolate = env->isolate(); Local obj = object(isolate); - Local context = obj->GetCreationContext().ToLocalChecked(); std::shared_ptr msg = std::make_shared(); @@ -986,7 +986,7 @@ void MessagePort::PostMessage(const FunctionCallbackInfo& args) { return; } - Maybe res = port->PostMessage(env, args[0], transfer_list); + Maybe res = port->PostMessage(env, context, args[0], transfer_list); if (res.IsJust()) args.GetReturnValue().Set(res.FromJust()); } diff --git a/src/node_messaging.h b/src/node_messaging.h index eeef974ff353d5..643604e4a99f15 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -242,6 +242,7 @@ class MessagePort : public HandleWrap { // If this port is closed, or if there is no sibling, this message is // serialized with transfers, then silently discarded. v8::Maybe PostMessage(Environment* env, + v8::Local context, v8::Local message, const TransferList& transfer);