@@ -702,7 +702,8 @@ MaybeLocal<Value> MessagePort::ReceiveMessage(Local<Context> context,
702702void MessagePort::OnMessage (MessageProcessingMode mode) {
703703 Debug (this , " Running MessagePort::OnMessage()" );
704704 HandleScope handle_scope (env ()->isolate ());
705- Local<Context> context = object (env ()->isolate ())->CreationContext ();
705+ Local<Context> context =
706+ object (env ()->isolate ())->GetCreationContext ().ToLocalChecked ();
706707
707708 size_t processing_limit;
708709 if (mode == MessageProcessingMode::kNormalOperation ) {
@@ -815,7 +816,7 @@ Maybe<bool> MessagePort::PostMessage(Environment* env,
815816 const TransferList& transfer_v) {
816817 Isolate* isolate = env->isolate ();
817818 Local<Object> obj = object (isolate);
818- Local<Context> context = obj->CreationContext ();
819+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
819820
820821 std::shared_ptr<Message> msg = std::make_shared<Message>();
821822
@@ -913,7 +914,7 @@ static Maybe<bool> ReadIterable(Environment* env,
913914void MessagePort::PostMessage (const FunctionCallbackInfo<Value>& args) {
914915 Environment* env = Environment::GetCurrent (args);
915916 Local<Object> obj = args.This ();
916- Local<Context> context = obj->CreationContext ();
917+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
917918
918919 if (args.Length () == 0 ) {
919920 return THROW_ERR_MISSING_ARGS (env, " Not enough arguments to "
@@ -1021,9 +1022,9 @@ void MessagePort::ReceiveMessage(const FunctionCallbackInfo<Value>& args) {
10211022 return ;
10221023 }
10231024
1024- MaybeLocal<Value> payload =
1025- port->ReceiveMessage (port-> object ()->CreationContext (),
1026- MessageProcessingMode::kForceReadMessages );
1025+ MaybeLocal<Value> payload = port-> ReceiveMessage (
1026+ port->object ()->GetCreationContext (). ToLocalChecked (),
1027+ MessageProcessingMode::kForceReadMessages );
10271028 if (!payload.IsEmpty ())
10281029 args.GetReturnValue ().Set (payload.ToLocalChecked ());
10291030}
@@ -1382,7 +1383,7 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
13821383 return ;
13831384 }
13841385
1385- Local<Context> context = args.This ()->CreationContext ();
1386+ Local<Context> context = args.This ()->GetCreationContext (). ToLocalChecked ();
13861387 Context::Scope context_scope (context);
13871388
13881389 MessagePort* port1 = MessagePort::New (env, context);
0 commit comments