From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
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 569dafe82df83db02d93b0e58231ef804eb54be8..c6b8c3b5b36ea25a31bdf3c6a48ef20f3c1b6577 100644
--- a/src/node_errors.h
+++ b/src/node_errors.h
@@ -218,7 +218,7 @@ 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);
+      v8::TypedArray::kMaxByteLength);
   return ERR_BUFFER_TOO_LARGE(isolate, message);
 }
 
