diff --git a/src/node_buffer.h b/src/node_buffer.h index 81ed9481db656b..080dcce21da05c 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -29,7 +29,7 @@ namespace node { namespace Buffer { -static const size_t kMaxLength = v8::Uint8Array::kMaxLength; +static const size_t kMaxLength = v8::TypedArray::kMaxByteLength; typedef void (*FreeCallback)(char* data, void* hint); diff --git a/src/node_errors.h b/src/node_errors.h index 0a74373cf5d333..5ad25f0e668013 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -226,10 +226,9 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env, inline v8::Local ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) { char message[128]; - snprintf(message, - sizeof(message), - "Cannot create a Buffer larger than 0x%zx bytes", - Buffer::kMaxLength); + snprintf(message, sizeof(message), + "Cannot create a Buffer larger than 0x%zx bytes", + v8::TypedArray::kMaxByteLength); return ERR_BUFFER_TOO_LARGE(isolate, message); }