Skip to content

Commit 26e147d

Browse files
committed
support node 24
1 parent 3004bfb commit 26e147d

File tree

8 files changed

+22
-5
lines changed

8 files changed

+22
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/javascript-node:22
1+
FROM mcr.microsoft.com/devcontainers/javascript-node:24
22

33
# need to run update and install at the same time to prevent stale update layer
44
RUN apt-get update && apt-get install -y gdb clang-format openjdk-21-jdk maven

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
nodeVersion: [ 20, 22 ]
12+
nodeVersion: [ 20, 22, 24 ]
1313
jdkVersion: [ openjdk9, openjdk10, openjdk11, openjdk21 ]
1414
steps:
1515
- name: Checkout source code

.github/workflows/pull-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
nodeVersion: [ 20, 22 ]
13+
nodeVersion: [ 20, 22, 24 ]
1414
jdkVersion: [ openjdk9, openjdk10, openjdk11, openjdk21 ]
1515
steps:
1616
- name: Checkout source code

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ node-java.cbp
1111
*/.kdev_include_paths
1212
CMakeLists.txt
1313
cmake-build-debug/
14+
hs_err*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ Either `./scripts/postInstall.js` didn't run or there was a problem detecting ja
884884
## Debugging
885885

886886
npm install
887-
node-gyp build --debug
887+
npx node-gyp build --debug
888888
gdb --args "$(which node)" ./node_modules/.bin/vitest test
889889

890890
## License

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-cpp/javaObject.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,15 @@ NAN_INDEX_GETTER(JavaObject::indexGetter) {
325325
assertNoException(env);
326326
if ((jint)index >= arrayLength) {
327327
info.GetReturnValue().SetUndefined();
328-
return;
328+
RETURN_INTERCEPTED_YES;
329329
}
330330

331331
jmethodID array_get = env->GetStaticMethodID(arrayClass, "get", "(Ljava/lang/Object;I)Ljava/lang/Object;");
332332
jobject item = env->CallStaticObjectMethod(arrayClass, array_get, self->m_obj, index);
333333
assertNoException(env);
334334
v8::Local<v8::Value> result = javaToV8(self->m_java, env, item);
335335
info.GetReturnValue().Set(result);
336+
RETURN_INTERCEPTED_YES;
336337
}
337338

338339
/*static*/ Nan::Persistent<v8::FunctionTemplate> JavaProxyObject::s_proxyCt;

src-cpp/utils.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ class Java;
1616
#define V8_HIDDEN_MARKER_JAVA_LONG "__isJavaLong"
1717
#define V8_HIDDEN_MARKER_JAVA_OBJECT "__isJavaObject"
1818

19+
#if NODE_MAJOR_VERSION >= 23
20+
#define RETURN_INTERCEPTED_YES return v8::Intercepted::kYes
21+
#define RETURN_INTERCEPTED_NO return v8::Intercepted::kNo
22+
#else
23+
#define RETURN_INTERCEPTED_YES return
24+
#define RETURN_INTERCEPTED_NO return
25+
#endif
26+
1927
typedef enum _jvalueType {
2028
TYPE_VOID = 1,
2129
TYPE_INT = 2,

0 commit comments

Comments
 (0)