Skip to content

Commit 11f790d

Browse files
isheludkotargos
andcommitted
src: do not use deprecated V8 API
Namely: - `v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, ...);` - `v8::ObjectTemplate::SetNativeDataProperty` with `AccessControl` Refs: v8/v8@46c241e Refs: v8/v8@6ec8839 Co-authored-by: Michaël Zasso <[email protected]> PR-URL: #53084 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 6165894 commit 11f790d

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

src/base_object-inl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ v8::EmbedderGraph::Node::Detachedness BaseObject::GetDetachedness() const {
132132

133133
template <int Field>
134134
void BaseObject::InternalFieldGet(
135-
v8::Local<v8::String> property,
135+
v8::Local<v8::Name> property,
136136
const v8::PropertyCallbackInfo<v8::Value>& info) {
137137
info.GetReturnValue().Set(
138138
info.This()->GetInternalField(Field).As<v8::Value>());
139139
}
140140

141-
template <int Field, bool (v8::Value::* typecheck)() const>
142-
void BaseObject::InternalFieldSet(v8::Local<v8::String> property,
141+
template <int Field, bool (v8::Value::*typecheck)() const>
142+
void BaseObject::InternalFieldSet(v8::Local<v8::Name> property,
143143
v8::Local<v8::Value> value,
144144
const v8::PropertyCallbackInfo<void>& info) {
145145
// This could be e.g. value->IsFunction().

src/base_object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ class BaseObject : public MemoryRetainer {
111111

112112
// Setter/Getter pair for internal fields that can be passed to SetAccessor.
113113
template <int Field>
114-
static void InternalFieldGet(v8::Local<v8::String> property,
114+
static void InternalFieldGet(v8::Local<v8::Name> property,
115115
const v8::PropertyCallbackInfo<v8::Value>& info);
116116
template <int Field, bool (v8::Value::*typecheck)() const>
117-
static void InternalFieldSet(v8::Local<v8::String> property,
117+
static void InternalFieldSet(v8::Local<v8::Name> property,
118118
v8::Local<v8::Value> value,
119119
const v8::PropertyCallbackInfo<void>& info);
120120

src/node_builtins.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace node {
1111
namespace builtins {
1212

1313
using v8::Context;
14-
using v8::DEFAULT;
1514
using v8::EscapableHandleScope;
1615
using v8::Function;
1716
using v8::FunctionCallbackInfo;
@@ -710,15 +709,13 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data,
710709
nullptr,
711710
Local<Value>(),
712711
None,
713-
DEFAULT,
714712
SideEffectType::kHasNoSideEffect);
715713

716714
target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"),
717715
BuiltinIdsGetter,
718716
nullptr,
719717
Local<Value>(),
720718
None,
721-
DEFAULT,
722719
SideEffectType::kHasNoSideEffect);
723720

724721
target->SetNativeDataProperty(
@@ -727,15 +724,13 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data,
727724
nullptr,
728725
Local<Value>(),
729726
None,
730-
DEFAULT,
731727
SideEffectType::kHasNoSideEffect);
732728

733729
target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "natives"),
734730
GetNatives,
735731
nullptr,
736732
Local<Value>(),
737733
None,
738-
DEFAULT,
739734
SideEffectType::kHasNoSideEffect);
740735

741736
SetMethod(isolate, target, "getCacheUsage", BuiltinLoader::GetCacheUsage);

src/node_external_reference.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ class ExternalReferenceRegistry {
6868
V(CFunctionWithBool) \
6969
V(const v8::CFunctionInfo*) \
7070
V(v8::FunctionCallback) \
71-
V(v8::AccessorGetterCallback) \
72-
V(v8::AccessorSetterCallback) \
7371
V(v8::AccessorNameGetterCallback) \
7472
V(v8::AccessorNameSetterCallback) \
7573
V(v8::NamedPropertyGetterCallback) \

0 commit comments

Comments
 (0)