diff --git a/src/utils.cpp b/src/utils.cpp index 6c899555..1c8aceca 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -484,7 +484,11 @@ jvalueType javaGetArrayComponentType(JNIEnv *env, jobjectArray array) { #if (NODE_VERSION_AT_LEAST(4, 0, 0)) v8::Local newArrayBuffer(void* elems, size_t length) { v8::Local ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), length); +#if (V8_MAJOR_VERSION >= 8) + memcpy(ab->GetBackingStore()->Data(), elems, length); +#else memcpy(ab->GetContents().Data(), elems, length); +#endif return ab; } #endif