@@ -491,8 +491,12 @@ Maybe<bool> Message::Serialize(Environment* env, |
491 | 491 | Local<Object> entry = entry_val.As<Object>(); |
492 | 492 | // See https://github.com/nodejs/node/pull/30339#issuecomment-552225353 |
493 | 493 | // for details. |
494 | | - if (entry->HasPrivate(context, env->untransferable_object_private_symbol()) |
495 | | - .ToChecked()) { |
| 494 | + bool ans; |
| 495 | + if (!entry->HasPrivate(context, env->untransferable_object_private_symbol()) |
| 496 | + .To(&ans)) { |
| 497 | + return Nothing<bool>(); |
| 498 | + } |
| 499 | + if (ans) { |
496 | 500 | ThrowDataCloneException(context, env->transfer_unsupported_type_str()); |
497 | 501 | return Nothing<bool>(); |
498 | 502 | } |
@@ -591,7 +595,9 @@ Maybe<bool> Message::Serialize(Environment* env, |
591 | 595 | for (Local<ArrayBuffer> ab : array_buffers) { |
592 | 596 | // If serialization succeeded, we render it inaccessible in this Isolate. |
593 | 597 | std::shared_ptr<BackingStore> backing_store = ab->GetBackingStore(); |
594 | | - ab->Detach(Local<Value>()).Check(); |
| 598 | + if (ab->Detach(Local<Value>()).IsNothing()) { |
| 599 | + return Nothing<bool>(); |
| 600 | + } |
595 | 601 |
|
596 | 602 | array_buffers_.emplace_back(std::move(backing_store)); |
597 | 603 | } |
@@ -1073,7 +1079,10 @@ bool GetTransferList(Environment* env, |
1073 | 1079 | void MessagePort::PostMessage(const FunctionCallbackInfo<Value>& args) { |
1074 | 1080 | Environment* env = Environment::GetCurrent(args); |
1075 | 1081 | Local<Object> obj = args.This(); |
1076 | | - Local<Context> context = obj->GetCreationContextChecked(); |
| 1082 | + Local<Context> context; |
| 1083 | + if (!obj->GetCreationContext().ToLocal(&context)) { |
| 1084 | + return; |
| 1085 | + } |
1077 | 1086 |
|
1078 | 1087 | if (args.Length() == 0) { |
1079 | 1088 | return THROW_ERR_MISSING_ARGS(env, "Not enough arguments to " |
@@ -1160,8 +1169,11 @@ void MessagePort::ReceiveMessage(const FunctionCallbackInfo<Value>& args) { |
1160 | 1169 | } |
1161 | 1170 |
|
1162 | 1171 | Local<Value> payload; |
1163 | | - if (port->ReceiveMessage(port->object()->GetCreationContextChecked(), |
1164 | | - MessageProcessingMode::kForceReadMessages) |
| 1172 | + Local<Context> context; |
| 1173 | + if (!port->object()->GetCreationContext().ToLocal(&context)) { |
| 1174 | + return; |
| 1175 | + } |
| 1176 | + if (port->ReceiveMessage(context, MessageProcessingMode::kForceReadMessages) |
1165 | 1177 | .ToLocal(&payload)) { |
1166 | 1178 | args.GetReturnValue().Set(payload); |
1167 | 1179 | } |
@@ -1619,7 +1631,10 @@ static void MessageChannel(const FunctionCallbackInfo<Value>& args) { |
1619 | 1631 | return; |
1620 | 1632 | } |
1621 | 1633 |
|
1622 | | - Local<Context> context = args.This()->GetCreationContextChecked(); |
| 1634 | + Local<Context> context; |
| 1635 | + if (!args.This()->GetCreationContext().ToLocal(&context)) { |
| 1636 | + return; |
| 1637 | + } |
1623 | 1638 | Context::Scope context_scope(context); |
1624 | 1639 |
|
1625 | 1640 | MessagePort* port1 = MessagePort::New(env, context); |
|