@@ -727,7 +727,8 @@ MaybeLocal<Value> MessagePort::ReceiveMessage(Local<Context> context,
727727void MessagePort::OnMessage (MessageProcessingMode mode) {
728728 Debug (this , " Running MessagePort::OnMessage()" );
729729 HandleScope handle_scope (env ()->isolate ());
730- Local<Context> context = object (env ()->isolate ())->CreationContext ();
730+ Local<Context> context =
731+ object (env ()->isolate ())->GetCreationContext ().ToLocalChecked ();
731732
732733 size_t processing_limit;
733734 if (mode == MessageProcessingMode::kNormalOperation ) {
@@ -843,7 +844,7 @@ Maybe<bool> MessagePort::PostMessage(Environment* env,
843844 const TransferList& transfer_v) {
844845 Isolate* isolate = env->isolate ();
845846 Local<Object> obj = object (isolate);
846- Local<Context> context = obj->CreationContext ();
847+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
847848
848849 std::shared_ptr<Message> msg = std::make_shared<Message>();
849850
@@ -941,7 +942,7 @@ static Maybe<bool> ReadIterable(Environment* env,
941942void MessagePort::PostMessage (const FunctionCallbackInfo<Value>& args) {
942943 Environment* env = Environment::GetCurrent (args);
943944 Local<Object> obj = args.This ();
944- Local<Context> context = obj->CreationContext ();
945+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
945946
946947 if (args.Length () == 0 ) {
947948 return THROW_ERR_MISSING_ARGS (env, " Not enough arguments to "
@@ -1049,9 +1050,9 @@ void MessagePort::ReceiveMessage(const FunctionCallbackInfo<Value>& args) {
10491050 return ;
10501051 }
10511052
1052- MaybeLocal<Value> payload =
1053- port->ReceiveMessage (port-> object ()->CreationContext (),
1054- MessageProcessingMode::kForceReadMessages );
1053+ MaybeLocal<Value> payload = port-> ReceiveMessage (
1054+ port->object ()->GetCreationContext (). ToLocalChecked (),
1055+ MessageProcessingMode::kForceReadMessages );
10551056 if (!payload.IsEmpty ())
10561057 args.GetReturnValue ().Set (payload.ToLocalChecked ());
10571058}
@@ -1410,7 +1411,7 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
14101411 return ;
14111412 }
14121413
1413- Local<Context> context = args.This ()->CreationContext ();
1414+ Local<Context> context = args.This ()->GetCreationContext (). ToLocalChecked ();
14141415 Context::Scope context_scope (context);
14151416
14161417 MessagePort* port1 = MessagePort::New (env, context);
0 commit comments