diff --git a/src/api/callback.cc b/src/api/callback.cc index 3a8bd9155a8545..579bfb6e7fda5c 100644 --- a/src/api/callback.cc +++ b/src/api/callback.cc @@ -248,8 +248,7 @@ MaybeLocal MakeCallback(Isolate* isolate, Local argv[], async_context asyncContext) { // Check can_call_into_js() first because calling Get() might do so. - Environment* env = - Environment::GetCurrent(recv->GetCreationContext().ToLocalChecked()); + Environment* env = Environment::GetCurrent(recv->GetCreationContextChecked()); CHECK_NOT_NULL(env); if (!env->can_call_into_js()) return Local(); @@ -279,7 +278,7 @@ MaybeLocal MakeCallback(Isolate* isolate, // Because of the AssignToContext() call in src/node_contextify.cc, // the two contexts need not be the same. Environment* env = - Environment::GetCurrent(callback->GetCreationContext().ToLocalChecked()); + Environment::GetCurrent(callback->GetCreationContextChecked()); CHECK_NOT_NULL(env); Context::Scope context_scope(env->context()); MaybeLocal ret = @@ -302,7 +301,7 @@ MaybeLocal MakeSyncCallback(Isolate* isolate, int argc, Local argv[]) { Environment* env = - Environment::GetCurrent(callback->GetCreationContext().ToLocalChecked()); + Environment::GetCurrent(callback->GetCreationContextChecked()); CHECK_NOT_NULL(env); if (!env->can_call_into_js()) return Local(); diff --git a/src/base_object-inl.h b/src/base_object-inl.h index 2ca432e2dfd3c6..da8fed7b3013df 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -55,8 +55,7 @@ v8::Local BaseObject::object() const { v8::Local BaseObject::object(v8::Isolate* isolate) const { v8::Local handle = object(); - DCHECK_EQ(handle->GetCreationContext().ToLocalChecked()->GetIsolate(), - isolate); + DCHECK_EQ(handle->GetCreationContextChecked()->GetIsolate(), isolate); DCHECK_EQ(env()->isolate(), isolate); return handle; diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 895ff3a5948add..f4c123a0834201 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -88,7 +88,7 @@ Local ModuleWrap::context() const { // If this fails, there is likely a bug e.g. ModuleWrap::context() is accessed // before the ModuleWrap constructor completes. CHECK(obj->IsObject()); - return obj.As()->GetCreationContext().ToLocalChecked(); + return obj.As()->GetCreationContextChecked(); } ModuleWrap* ModuleWrap::GetFromModule(Environment* env, diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 6c9a23e669b29d..e7d2bfbafef13f 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -790,7 +790,7 @@ void MessagePort::OnMessage(MessageProcessingMode mode) { HandleScope handle_scope(env()->isolate()); Local context = - object(env()->isolate())->GetCreationContext().ToLocalChecked(); + object(env()->isolate())->GetCreationContextChecked(); size_t processing_limit; if (mode == MessageProcessingMode::kNormalOperation) { @@ -1048,7 +1048,7 @@ bool GetTransferList(Environment* env, void MessagePort::PostMessage(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local obj = args.This(); - Local context = obj->GetCreationContext().ToLocalChecked(); + Local context = obj->GetCreationContextChecked(); if (args.Length() == 0) { return THROW_ERR_MISSING_ARGS(env, "Not enough arguments to " @@ -1134,9 +1134,9 @@ void MessagePort::ReceiveMessage(const FunctionCallbackInfo& args) { return; } - MaybeLocal payload = port->ReceiveMessage( - port->object()->GetCreationContext().ToLocalChecked(), - MessageProcessingMode::kForceReadMessages); + MaybeLocal payload = + port->ReceiveMessage(port->object()->GetCreationContextChecked(), + MessageProcessingMode::kForceReadMessages); if (!payload.IsEmpty()) args.GetReturnValue().Set(payload.ToLocalChecked()); } @@ -1547,7 +1547,7 @@ static void MessageChannel(const FunctionCallbackInfo& args) { return; } - Local context = args.This()->GetCreationContext().ToLocalChecked(); + Local context = args.This()->GetCreationContextChecked(); Context::Scope context_scope(context); MessagePort* port1 = MessagePort::New(env, context); diff --git a/src/node_worker.cc b/src/node_worker.cc index 0affbe7c85a013..552fdc438a0895 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -907,7 +907,7 @@ void GetEnvMessagePort(const FunctionCallbackInfo& args) { Local port = env->message_port(); CHECK_IMPLIES(!env->is_main_thread(), !port.IsEmpty()); if (!port.IsEmpty()) { - CHECK_EQ(port->GetCreationContext().ToLocalChecked()->GetIsolate(), + CHECK_EQ(port->GetCreationContextChecked()->GetIsolate(), args.GetIsolate()); args.GetReturnValue().Set(port); }