1234567891011121314151617181920212223242526272829303132333435 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Charles Kerr <[email protected]>
- Date: Tue, 17 Oct 2023 10:58:41 -0500
- Subject: chore: remove use of deprecated kMaxLength
- https://chromium-review.googlesource.com/c/v8/v8/+/4935412
- This patch can be removed when upstream moves to kMaxByteLength
- diff --git a/src/node_buffer.h b/src/node_buffer.h
- index 606a6f5caa3b11b6d2a9068ed2fd65800530a5eb..080dcce21da05ccea398d8a856deb397b1ac8b07 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::TypedArray::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 1662491bac44311421eeb7ee35bb47c025162abf..a62b18e832986ee38d93b412b36020a2c22255a9 100644
- --- a/src/node_errors.h
- +++ b/src/node_errors.h
- @@ -230,7 +230,7 @@ inline v8::Local<v8::Object> 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);
- + v8::TypedArray::kMaxByteLength);
- return ERR_BUFFER_TOO_LARGE(isolate, message);
- }
-
|