Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ MaybeLocal<Object> InitializePrivateSymbols(Local<Context> context,

Local<Object> private_symbols_object;
if (!private_symbols->NewInstance(context).ToLocal(&private_symbols_object) ||
private_symbols_object->SetPrototypeV2(context, Null(isolate))
private_symbols_object->SetPrototype(context, Null(isolate))
.IsNothing()) {
return MaybeLocal<Object>();
}
Expand All @@ -984,7 +984,7 @@ MaybeLocal<Object> InitializePerIsolateSymbols(Local<Context> context,
Local<Object> per_isolate_symbols_object;
if (!per_isolate_symbols->NewInstance(context).ToLocal(
&per_isolate_symbols_object) ||
per_isolate_symbols_object->SetPrototypeV2(context, Null(isolate))
per_isolate_symbols_object->SetPrototype(context, Null(isolate))
.IsNothing()) {
return MaybeLocal<Object>();
}
Expand Down
4 changes: 2 additions & 2 deletions src/internal_only_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class PrototypeChainHas : public v8::QueryObjectPredicate {
if (creation_context != context_) {
return false;
}
for (Local<Value> proto = object->GetPrototypeV2(); proto->IsObject();
proto = proto.As<Object>()->GetPrototypeV2()) {
for (Local<Value> proto = object->GetPrototype(); proto->IsObject();
proto = proto.As<Object>()->GetPrototype()) {
if (search_ == proto) return true;
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ napi_status NAPI_CDECL node_api_set_prototype(napi_env env,

v8::Local<v8::Value> val = v8impl::V8LocalValueFromJsValue(value);

v8::Maybe<bool> set_maybe = obj->SetPrototypeV2(context, val);
v8::Maybe<bool> set_maybe = obj->SetPrototype(context, val);

RETURN_STATUS_IF_FALSE_WITH_PREAMBLE(
env, set_maybe.FromMaybe(false), napi_generic_failure);
Expand All @@ -1604,7 +1604,7 @@ napi_status NAPI_CDECL napi_get_prototype(napi_env env,
CHECK_TO_OBJECT(env, context, obj, object);

// This doesn't invokes Proxy's [[GetPrototypeOf]] handler.
v8::Local<v8::Value> val = obj->GetPrototypeV2();
v8::Local<v8::Value> val = obj->GetPrototype();
*result = v8impl::JsValueFromV8LocalValue(val);
return GET_RETURN_STATUS(env);
}
Expand Down
6 changes: 3 additions & 3 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ void ModuleWrap::HasAsyncGraph(Local<Name> property,
Isolate* isolate = args.GetIsolate();
Environment* env = Environment::GetCurrent(isolate);
ModuleWrap* obj;
ASSIGN_OR_RETURN_UNWRAP(&obj, args.HolderV2());
ASSIGN_OR_RETURN_UNWRAP(&obj, args.Holder());

Local<Module> module = obj->module_.Get(isolate);
if (module->GetStatus() < Module::kInstantiated) {
Expand Down Expand Up @@ -1251,7 +1251,7 @@ void ModuleWrap::SetImportMetaResolveInitializer(
static void ImportMetaResolveLazyGetter(
Local<v8::Name> name, const PropertyCallbackInfo<Value>& info) {
Isolate* isolate = info.GetIsolate();
Local<Value> receiver_val = info.HolderV2();
Local<Value> receiver_val = info.Holder();
if (!receiver_val->IsObject()) {
THROW_ERR_INVALID_INVOCATION(isolate);
return;
Expand Down Expand Up @@ -1292,7 +1292,7 @@ static void PathHelpersLazyGetter(Local<v8::Name> name,
// When this getter is invoked in a vm context, the `Realm::GetCurrent(info)`
// returns a nullptr and retrieve the creation context via `this` object and
// get the creation Realm.
Local<Value> receiver_val = info.HolderV2();
Local<Value> receiver_val = info.Holder();
if (!receiver_val->IsObject()) {
THROW_ERR_INVALID_INVOCATION(isolate);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ MaybeLocal<Uint8Array> New(Environment* env,
size_t length) {
CHECK(!env->buffer_prototype_object().IsEmpty());
Local<Uint8Array> ui = Uint8Array::New(ab, byte_offset, length);
if (ui->SetPrototypeV2(env->context(), env->buffer_prototype_object())
if (ui->SetPrototype(env->context(), env->buffer_prototype_object())
.IsNothing()) {
return MaybeLocal<Uint8Array>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ void CreatePerContextProperties(Local<Object> target,
Isolate* isolate = Isolate::GetCurrent();
Environment* env = Environment::GetCurrent(context);

CHECK(target->SetPrototypeV2(env->context(), Null(isolate)).FromJust());
CHECK(target->SetPrototype(env->context(), Null(isolate)).FromJust());

Local<Object> os_constants =
Object::New(isolate, Null(isolate), nullptr, nullptr, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ ContextifyContext* ContextifyContext::Get(const PropertyCallbackInfo<T>& args) {
// args.GetIsolate()->GetCurrentContext() and take the pointer at
// ContextEmbedderIndex::kContextifyContext, as V8 is supposed to
// push the creation context before invoking these callbacks.
return Get(args.HolderV2());
return Get(args.Holder());
}

ContextifyContext* ContextifyContext::Get(Local<Object> object) {
Expand Down
4 changes: 2 additions & 2 deletions src/node_ffi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ void DynamicLibrary::GetFunctions(const FunctionCallbackInfo<Value>& args) {
}

Local<Object> functions = Object::New(isolate);
if (!functions->SetPrototypeV2(context, Null(isolate)).FromMaybe(false)) {
if (!functions->SetPrototype(context, Null(isolate)).FromMaybe(false)) {
return;
}

Expand Down Expand Up @@ -645,7 +645,7 @@ void DynamicLibrary::GetSymbols(const FunctionCallbackInfo<Value>& args) {
}

Local<Object> symbols = Object::New(isolate);
if (!symbols->SetPrototypeV2(context, Null(isolate)).FromMaybe(false)) {
if (!symbols->SetPrototype(context, Null(isolate)).FromMaybe(false)) {
return;
}
for (const auto& entry : lib->symbols_) {
Expand Down
6 changes: 2 additions & 4 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,7 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {

Local<Map> options = Map::New(isolate);
if (options
->SetPrototypeV2(context,
env->primordials_safe_map_prototype_object())
->SetPrototype(context, env->primordials_safe_map_prototype_object())
.IsNothing()) {
return;
}
Expand Down Expand Up @@ -1871,8 +1870,7 @@ void GetCLIOptionsInfo(const FunctionCallbackInfo<Value>& args) {
if (!ToV8Value(context, _ppop_instance.aliases_).ToLocal(&aliases)) return;

if (aliases.As<Object>()
->SetPrototypeV2(context,
env->primordials_safe_map_prototype_object())
->SetPrototype(context, env->primordials_safe_map_prototype_object())
.IsNothing()) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/node_sqlite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ Intercepted DatabaseSyncLimits::LimitsGetter(
}

DatabaseSyncLimits* limits;
ASSIGN_OR_RETURN_UNWRAP(&limits, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&limits, info.Holder(), Intercepted::kNo);

Environment* env = limits->env();
Isolate* isolate = env->isolate();
Expand Down Expand Up @@ -780,7 +780,7 @@ Intercepted DatabaseSyncLimits::LimitsSetter(
}

DatabaseSyncLimits* limits;
ASSIGN_OR_RETURN_UNWRAP(&limits, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&limits, info.Holder(), Intercepted::kNo);

Environment* env = limits->env();
Isolate* isolate = env->isolate();
Expand Down Expand Up @@ -2945,9 +2945,9 @@ BaseObjectPtr<StatementSyncIterator> StatementExecutionHelper::Iterate(
}

if (iter->object()
->GetPrototypeV2()
->GetPrototype()
.As<Object>()
->SetPrototypeV2(context, js_iterator_prototype)
->SetPrototype(context, js_iterator_prototype)
.IsNothing()) {
return BaseObjectPtr<StatementSyncIterator>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/node_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static void DefineLazyPropertiesGetter(
// When this getter is invoked in a vm context, the `Realm::GetCurrent(info)`
// returns a nullptr and retrieve the creation context via `this` object and
// get the creation Realm.
Local<Value> receiver_val = info.HolderV2();
Local<Value> receiver_val = info.Holder();
if (!receiver_val->IsObject()) {
THROW_ERR_INVALID_INVOCATION(isolate);
return;
Expand Down
14 changes: 7 additions & 7 deletions src/node_webstorage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ template <typename T>
static bool ShouldIntercept(Local<Name> property,
const PropertyCallbackInfo<T>& info) {
Environment* env = Environment::GetCurrent(info);
Local<Value> proto = info.HolderV2()->GetPrototypeV2();
Local<Value> proto = info.Holder()->GetPrototype();

if (proto->IsObject()) {
bool has_prop;
Expand All @@ -586,7 +586,7 @@ static Intercepted StorageGetter(Local<Name> property,
}

Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo);
Local<Value> result;

if (storage->Load(property).ToLocal(&result) && !result->IsNull()) {
Expand All @@ -600,7 +600,7 @@ static Intercepted StorageSetter(Local<Name> property,
Local<Value> value,
const PropertyCallbackInfo<Boolean>& info) {
Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo);

if (storage->Store(property, value).IsNothing()) {
info.GetReturnValue().SetFalse();
Expand All @@ -616,7 +616,7 @@ static Intercepted StorageQuery(Local<Name> property,
}

Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo);
Local<Value> result;
if (!storage->Load(property).ToLocal(&result) || result->IsNull()) {
return Intercepted::kNo;
Expand All @@ -629,7 +629,7 @@ static Intercepted StorageQuery(Local<Name> property,
static Intercepted StorageDeleter(Local<Name> property,
const PropertyCallbackInfo<Boolean>& info) {
Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo);

info.GetReturnValue().Set(storage->Remove(property).IsJust());

Expand All @@ -638,7 +638,7 @@ static Intercepted StorageDeleter(Local<Name> property,

static void StorageEnumerator(const PropertyCallbackInfo<Array>& info) {
Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2());
ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder());
Local<Array> result;
if (!storage->Enumerate().ToLocal(&result)) {
return;
Expand All @@ -650,7 +650,7 @@ static Intercepted StorageDefiner(Local<Name> property,
const PropertyDescriptor& desc,
const PropertyCallbackInfo<Boolean>& info) {
Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.HolderV2(), Intercepted::kNo);
ASSIGN_OR_RETURN_UNWRAP(&storage, info.Holder(), Intercepted::kNo);

if (desc.has_value()) {
return StorageSetter(property, desc.value(), info);
Expand Down
2 changes: 1 addition & 1 deletion src/util-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ inline v8::MaybeLocal<v8::Object> NewDictionaryInstanceNullProto(
if (value.IsEmpty()) return v8::MaybeLocal<v8::Object>();
}
v8::Local<v8::Object> obj = tmpl->NewInstance(context, property_values);
if (obj->SetPrototypeV2(context, v8::Null(v8::Isolate::GetCurrent()))
if (obj->SetPrototype(context, v8::Null(v8::Isolate::GetCurrent()))
.IsNothing()) {
return v8::MaybeLocal<v8::Object>();
}
Expand Down
Loading