@@ -702,7 +702,8 @@ MaybeLocal<Value> MessagePort::ReceiveMessage(Local<Context> context,
702
702
void MessagePort::OnMessage (MessageProcessingMode mode) {
703
703
Debug (this , " Running MessagePort::OnMessage()" );
704
704
HandleScope handle_scope (env ()->isolate ());
705
- Local<Context> context = object (env ()->isolate ())->CreationContext ();
705
+ Local<Context> context =
706
+ object (env ()->isolate ())->GetCreationContext ().ToLocalChecked ();
706
707
707
708
size_t processing_limit;
708
709
if (mode == MessageProcessingMode::kNormalOperation ) {
@@ -815,7 +816,7 @@ Maybe<bool> MessagePort::PostMessage(Environment* env,
815
816
const TransferList& transfer_v) {
816
817
Isolate* isolate = env->isolate ();
817
818
Local<Object> obj = object (isolate);
818
- Local<Context> context = obj->CreationContext ();
819
+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
819
820
820
821
std::shared_ptr<Message> msg = std::make_shared<Message>();
821
822
@@ -913,7 +914,7 @@ static Maybe<bool> ReadIterable(Environment* env,
913
914
void MessagePort::PostMessage (const FunctionCallbackInfo<Value>& args) {
914
915
Environment* env = Environment::GetCurrent (args);
915
916
Local<Object> obj = args.This ();
916
- Local<Context> context = obj->CreationContext ();
917
+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
917
918
918
919
if (args.Length () == 0 ) {
919
920
return THROW_ERR_MISSING_ARGS (env, " Not enough arguments to "
@@ -1021,9 +1022,9 @@ void MessagePort::ReceiveMessage(const FunctionCallbackInfo<Value>& args) {
1021
1022
return ;
1022
1023
}
1023
1024
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 );
1027
1028
if (!payload.IsEmpty ())
1028
1029
args.GetReturnValue ().Set (payload.ToLocalChecked ());
1029
1030
}
@@ -1382,7 +1383,7 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
1382
1383
return ;
1383
1384
}
1384
1385
1385
- Local<Context> context = args.This ()->CreationContext ();
1386
+ Local<Context> context = args.This ()->GetCreationContext (). ToLocalChecked ();
1386
1387
Context::Scope context_scope (context);
1387
1388
1388
1389
MessagePort* port1 = MessagePort::New (env, context);
0 commit comments