Skip to content
Open
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
6 changes: 5 additions & 1 deletion nan_typedarray_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ class TypedArrayContents {
v8::Local<v8::ArrayBuffer> buffer = array->Buffer();

length = byte_length / sizeof(T);
#if (V8_MAJOR_VERSION >= 10 || \
(V8_MAJOR_VERSION == 10 && \
(defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 5)))
data = static_cast<char*>(buffer->Data()) + byte_offset;
// Actually it's 7.9 here but this would lead to ABI issues with Node.js 13
// using 7.8 till 13.2.0.
#if (V8_MAJOR_VERSION >= 8)
#elif (V8_MAJOR_VERSION >= 8)
data = static_cast<char*>(buffer->GetBackingStore()->Data()) + byte_offset;
#else
data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
Expand Down