FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

support node 24 by joeferner · Pull Request #625 · joeferner/node-java · GitHub

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

Filter by extension

Filter by extension .cpp  (1) .h  (1) .json  (1) .md  (1) .yml  (2) No extension  (1) dotfile  (1) All 7 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL