diff --git a/src/node_util.cc b/src/node_util.cc index ec3f8e1fe7deaf..eb956daac6c782 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -148,11 +148,11 @@ static void GetHiddenValue(const FunctionCallbackInfo& args) { CHECK(args[1]->IsUint32()); Local obj = args[0].As(); - auto index = args[1]->Uint32Value(env->context()).FromJust(); - auto private_symbol = IndexToPrivateSymbol(env, index); - auto maybe_value = obj->GetPrivate(env->context(), private_symbol); - - args.GetReturnValue().Set(maybe_value.ToLocalChecked()); + uint32_t index = args[1].As()->Value(); + Local private_symbol = IndexToPrivateSymbol(env, index); + Local ret; + if (obj->GetPrivate(env->context(), private_symbol).ToLocal(&ret)) + args.GetReturnValue().Set(ret); } static void SetHiddenValue(const FunctionCallbackInfo& args) { @@ -162,11 +162,11 @@ static void SetHiddenValue(const FunctionCallbackInfo& args) { CHECK(args[1]->IsUint32()); Local obj = args[0].As(); - auto index = args[1]->Uint32Value(env->context()).FromJust(); - auto private_symbol = IndexToPrivateSymbol(env, index); - auto maybe_value = obj->SetPrivate(env->context(), private_symbol, args[2]); - - args.GetReturnValue().Set(maybe_value.FromJust()); + uint32_t index = args[1].As()->Value(); + Local private_symbol = IndexToPrivateSymbol(env, index); + bool ret; + if (obj->SetPrivate(env->context(), private_symbol, args[2]).To(&ret)) + args.GetReturnValue().Set(ret); } static void Sleep(const FunctionCallbackInfo& args) {