Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:22
FROM mcr.microsoft.com/devcontainers/javascript-node:24

# need to run update and install at the same time to prevent stale update layer
RUN apt-get update && apt-get install -y gdb clang-format openjdk-21-jdk maven
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
nodeVersion: [ 20, 22 ]
nodeVersion: [ 20, 22, 24 ]
jdkVersion: [ openjdk9, openjdk10, openjdk11, openjdk21 ]
steps:
- name: Checkout source code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
nodeVersion: [ 20, 22 ]
nodeVersion: [ 20, 22, 24 ]
jdkVersion: [ openjdk9, openjdk10, openjdk11, openjdk21 ]
steps:
- name: Checkout source code
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ node-java.cbp
*/.kdev_include_paths
CMakeLists.txt
cmake-build-debug/
hs_err*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ Either `./scripts/postInstall.js` didn't run or there was a problem detecting ja
## Debugging

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

## License
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src-cpp/javaObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,15 @@ NAN_INDEX_GETTER(JavaObject::indexGetter) {
assertNoException(env);
if ((jint)index >= arrayLength) {
info.GetReturnValue().SetUndefined();
return;
RETURN_INTERCEPTED_YES;
}

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

/*static*/ Nan::Persistent<v8::FunctionTemplate> JavaProxyObject::s_proxyCt;
Expand Down
8 changes: 8 additions & 0 deletions src-cpp/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ class Java;
#define V8_HIDDEN_MARKER_JAVA_LONG "__isJavaLong"
#define V8_HIDDEN_MARKER_JAVA_OBJECT "__isJavaObject"

#if NODE_MAJOR_VERSION >= 23
#define RETURN_INTERCEPTED_YES return v8::Intercepted::kYes
#define RETURN_INTERCEPTED_NO return v8::Intercepted::kNo
#else
#define RETURN_INTERCEPTED_YES return
#define RETURN_INTERCEPTED_NO return
#endif

typedef enum _jvalueType {
TYPE_VOID = 1,
TYPE_INT = 2,
Expand Down