mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
src: use non-deprecated v8::Uint8Array::kMaxLength
PR-URL: https://github.com/nodejs/node/pull/50115 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
parent
7166986626
commit
1528846ada
@ -29,7 +29,7 @@ namespace node {
|
||||
|
||||
namespace Buffer {
|
||||
|
||||
static const size_t kMaxLength = v8::TypedArray::kMaxLength;
|
||||
static const size_t kMaxLength = v8::Uint8Array::kMaxLength;
|
||||
|
||||
typedef void (*FreeCallback)(char* data, void* hint);
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
|
||||
#include "debug_utils-inl.h"
|
||||
#include "env.h"
|
||||
#include "node_buffer.h"
|
||||
#include "v8.h"
|
||||
|
||||
// Use ostringstream to print exact-width integer types
|
||||
@ -220,9 +221,10 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env,
|
||||
|
||||
inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
|
||||
char message[128];
|
||||
snprintf(message, sizeof(message),
|
||||
"Cannot create a Buffer larger than 0x%zx bytes",
|
||||
v8::TypedArray::kMaxLength);
|
||||
snprintf(message,
|
||||
sizeof(message),
|
||||
"Cannot create a Buffer larger than 0x%zx bytes",
|
||||
Buffer::kMaxLength);
|
||||
return ERR_BUFFER_TOO_LARGE(isolate, message);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user