Skip to content

Commit 1528846

Browse files
committed
src: use non-deprecated v8::Uint8Array::kMaxLength
PR-URL: #50115 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 7166986 commit 1528846

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/node_buffer.h

+1-1
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

+5-3
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
@@ -220,9 +221,10 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env,
220221

221222
inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
222223
char message[128];
223-
snprintf(message, sizeof(message),
224-
"Cannot create a Buffer larger than 0x%zx bytes",
225-
v8::TypedArray::kMaxLength);
224+
snprintf(message,
225+
sizeof(message),
226+
"Cannot create a Buffer larger than 0x%zx bytes",
227+
Buffer::kMaxLength);
226228
return ERR_BUFFER_TOO_LARGE(isolate, message);
227229
}
228230

0 commit comments

Comments
 (0)