@@ -727,7 +727,8 @@ MaybeLocal<Value> MessagePort::ReceiveMessage(Local<Context> context,
727
727
void MessagePort::OnMessage (MessageProcessingMode mode) {
728
728
Debug (this , " Running MessagePort::OnMessage()" );
729
729
HandleScope handle_scope (env ()->isolate ());
730
- Local<Context> context = object (env ()->isolate ())->CreationContext ();
730
+ Local<Context> context =
731
+ object (env ()->isolate ())->GetCreationContext ().ToLocalChecked ();
731
732
732
733
size_t processing_limit;
733
734
if (mode == MessageProcessingMode::kNormalOperation ) {
@@ -843,7 +844,7 @@ Maybe<bool> MessagePort::PostMessage(Environment* env,
843
844
const TransferList& transfer_v) {
844
845
Isolate* isolate = env->isolate ();
845
846
Local<Object> obj = object (isolate);
846
- Local<Context> context = obj->CreationContext ();
847
+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
847
848
848
849
std::shared_ptr<Message> msg = std::make_shared<Message>();
849
850
@@ -941,7 +942,7 @@ static Maybe<bool> ReadIterable(Environment* env,
941
942
void MessagePort::PostMessage (const FunctionCallbackInfo<Value>& args) {
942
943
Environment* env = Environment::GetCurrent (args);
943
944
Local<Object> obj = args.This ();
944
- Local<Context> context = obj->CreationContext ();
945
+ Local<Context> context = obj->GetCreationContext (). ToLocalChecked ();
945
946
946
947
if (args.Length () == 0 ) {
947
948
return THROW_ERR_MISSING_ARGS (env, " Not enough arguments to "
@@ -1049,9 +1050,9 @@ void MessagePort::ReceiveMessage(const FunctionCallbackInfo<Value>& args) {
1049
1050
return ;
1050
1051
}
1051
1052
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 );
1055
1056
if (!payload.IsEmpty ())
1056
1057
args.GetReturnValue ().Set (payload.ToLocalChecked ());
1057
1058
}
@@ -1410,7 +1411,7 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) {
1410
1411
return ;
1411
1412
}
1412
1413
1413
- Local<Context> context = args.This ()->CreationContext ();
1414
+ Local<Context> context = args.This ()->GetCreationContext (). ToLocalChecked ();
1414
1415
Context::Scope context_scope (context);
1415
1416
1416
1417
MessagePort* port1 = MessagePort::New (env, context);
0 commit comments