editors/vscode: Add patches to fix build error of keytar node module with clang 21

The error in question was:

  CXX(target) Release/obj.target/keytar/src/async.o
In file included from ../src/async.cc:4:
../node_modules/node-addon-api/napi.h:1147:39: error: in-class initializer for static data member is not a constant expression
 1147 |     static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
      |                                       ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/node-addon-api/napi.h:1147:60: note: integer value -1 is outside the valid range of values [0, 15] for the enumeration type 'napi_typedarray_type'
 1147 |     static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
      |                                                            ^
1 error generated.

PR:		295862
Reported by:	Alexey Shuvaev <bugsbeastie@gmail.com>
This commit is contained in:
Hiroki Tagato
2026-06-07 19:36:25 +09:00
parent 4517525856
commit 3666da5f42
3 changed files with 33 additions and 0 deletions
@@ -0,0 +1,11 @@
--- build/node_modules/node-addon-api/napi.h.orig 2026-06-07 09:08:42 UTC
+++ build/node_modules/node-addon-api/napi.h
@@ -1144,7 +1144,7 @@ namespace Napi {
TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length);
- static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
+ static inline const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
template <typename T>
static
@@ -0,0 +1,11 @@
--- extensions/copilot/node_modules/node-addon-api/napi.h.orig 2026-06-07 09:13:35 UTC
+++ extensions/copilot/node_modules/node-addon-api/napi.h
@@ -1144,7 +1144,7 @@ namespace Napi {
TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length);
- static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
+ static inline const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
template <typename T>
static
@@ -0,0 +1,11 @@
--- node_modules/keytar/node_modules/node-addon-api/napi.h.orig 2026-06-07 09:05:42 UTC
+++ node_modules/keytar/node_modules/node-addon-api/napi.h
@@ -1144,7 +1144,7 @@ namespace Napi {
TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length);
- static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
+ static inline const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
template <typename T>
static