Skip to content

Commit

Permalink
Don't use soon-to-be-deprecated V8 Api (#174)
Browse files Browse the repository at this point in the history
Namely v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, ...);
See https://crrev.com/c/v8/v8/+/5344409 for details.
  • Loading branch information
isheludko authored and victorgomes committed Apr 23, 2024
1 parent 2211457 commit 2b42e56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/base_object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ v8::EmbedderGraph::Node::Detachedness BaseObject::GetDetachedness() const {

template <int Field>
void BaseObject::InternalFieldGet(
v8::Local<v8::String> property,
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) {
info.GetReturnValue().Set(
info.This()->GetInternalField(Field).As<v8::Value>());
}

template <int Field, bool (v8::Value::* typecheck)() const>
void BaseObject::InternalFieldSet(v8::Local<v8::String> property,
void BaseObject::InternalFieldSet(v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) {
// This could be e.g. value->IsFunction().
Expand Down
4 changes: 2 additions & 2 deletions src/base_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ class BaseObject : public MemoryRetainer {

// Setter/Getter pair for internal fields that can be passed to SetAccessor.
template <int Field>
static void InternalFieldGet(v8::Local<v8::String> property,
static void InternalFieldGet(v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info);
template <int Field, bool (v8::Value::*typecheck)() const>
static void InternalFieldSet(v8::Local<v8::String> property,
static void InternalFieldSet(v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info);

Expand Down
2 changes: 0 additions & 2 deletions src/node_external_reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ class ExternalReferenceRegistry {
V(CFunctionWithBool) \
V(const v8::CFunctionInfo*) \
V(v8::FunctionCallback) \
V(v8::AccessorGetterCallback) \
V(v8::AccessorSetterCallback) \
V(v8::AccessorNameGetterCallback) \
V(v8::AccessorNameSetterCallback) \
V(v8::GenericNamedPropertyDefinerCallback) \
Expand Down

0 comments on commit 2b42e56

Please sign in to comment.