Skip to content

Commit 620a045

Browse files
committed
src: use non-deprecated v8::Uint8Array::kMaxLength
1 parent c745b63 commit 620a045

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/node_buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace node {
2929

3030
namespace Buffer {
3131

32-
static const size_t kMaxLength = v8::TypedArray::kMaxLength;
32+
static const size_t kMaxLength = v8::Uint8Array::kMaxLength;
3333

3434
typedef void (*FreeCallback)(char* data, void* hint);
3535

src/node_errors.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "debug_utils-inl.h"
77
#include "env.h"
8+
#include "node_buffer.h"
89
#include "v8.h"
910

1011
// Use ostringstream to print exact-width integer types
@@ -210,9 +211,10 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env,
210211

211212
inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
212213
char message[128];
213-
snprintf(message, sizeof(message),
214-
"Cannot create a Buffer larger than 0x%zx bytes",
215-
v8::TypedArray::kMaxLength);
214+
snprintf(message,
215+
sizeof(message),
216+
"Cannot create a Buffer larger than 0x%zx bytes",
217+
Buffer::kMaxLength);
216218
return ERR_BUFFER_TOO_LARGE(isolate, message);
217219
}
218220

0 commit comments

Comments
 (0)