diff --git a/nan_typedarray_contents.h b/nan_typedarray_contents.h index f2650eda..c9323e23 100644 --- a/nan_typedarray_contents.h +++ b/nan_typedarray_contents.h @@ -31,9 +31,13 @@ class TypedArrayContents { v8::Local 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(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(buffer->GetBackingStore()->Data()) + byte_offset; #else data = static_cast(buffer->GetContents().Data()) + byte_offset;