Skip to content

Commit 26a112e

Browse files
authored
Avoid deprecated TypedArray::kMaxLength field (#170)
Use TypedArray::kMaxByteLength instead.
1 parent 48baefc commit 26a112e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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::TypedArray::kMaxByteLength;
3333

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

src/node_errors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
212212
char message[128];
213213
snprintf(message, sizeof(message),
214214
"Cannot create a Buffer larger than 0x%zx bytes",
215-
v8::TypedArray::kMaxLength);
215+
v8::TypedArray::kMaxByteLength);
216216
return ERR_BUFFER_TOO_LARGE(isolate, message);
217217
}
218218

0 commit comments

Comments
 (0)