Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [25.x, 24.x, 23.x, 22.x, 21.x, 20.x, 19.x, 18.x, 17.x, 16.x]
node-version: [26.x, 25.x, 24.x, 23.x, 22.x, 21.x, 20.x, 19.x, 18.x, 17.x, 16.x]
os: [windows-latest]
include:
- node-version: lts/*
Expand Down
29 changes: 27 additions & 2 deletions nan_callbacks_12_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#ifndef NAN_CALLBACKS_12_INL_H_
#define NAN_CALLBACKS_12_INL_H_

#if defined(V8_MAJOR_VERSION) && \
(V8_MAJOR_VERSION > 14 || \
(V8_MAJOR_VERSION == 14 && \
defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 6))
# define NAN_HAS_PROPERTY_CALLBACK_INFO_HOLDER_V2 1
#endif

template<typename T>
class ReturnValue {
v8::ReturnValue<T> value_;
Expand Down Expand Up @@ -89,6 +96,12 @@ class ReturnValue {
inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); }
};

#if defined(NAN_HAS_PROPERTY_CALLBACK_INFO_HOLDER_V2)
template<>
template <typename S>
inline void ReturnValue<void>::Set(const v8::Local<S> &) {}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#endif

template<typename T>
class FunctionCallbackInfo {
const v8::FunctionCallbackInfo<T> &info_;
Expand Down Expand Up @@ -159,8 +172,20 @@ class PropertyCallbackInfo {

inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); }
inline v8::Local<v8::Value> Data() const { return data_; }
inline v8::Local<v8::Object> This() const { return info_.This(); }
inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
inline v8::Local<v8::Object> This() const {
#if defined(NAN_HAS_PROPERTY_CALLBACK_INFO_HOLDER_V2)
return info_.HolderV2();
#else
return info_.This();
#endif
}
inline v8::Local<v8::Object> Holder() const {
#if defined(NAN_HAS_PROPERTY_CALLBACK_INFO_HOLDER_V2)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return info_.HolderV2();
#else
return info_.Holder();
#endif
}
inline ReturnValue<T> GetReturnValue() const {
return ReturnValue<T>(info_.GetReturnValue());
}
Expand Down
Loading