From ac3b673d59875fd53f0315eb4f2282c8e2bbc3ed Mon Sep 17 00:00:00 2001 From: ishabi Date: Mon, 18 May 2026 14:50:06 +0200 Subject: [PATCH 1/2] support Node.js v26 --- .github/workflows/build.yml | 4 ++-- .gitlab/benchmarks.yml | 1 + bindings/profilers/wall.cc | 11 ++++++++++- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a927127..324ae78c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: asan: strategy: matrix: - version: [18, 20, 22, 24, 25] + version: [18, 20, 22, 24, 25, 26] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -23,7 +23,7 @@ jobs: valgrind: strategy: matrix: - version: [18, 20, 22, 24, 25] + version: [18, 20, 22, 24, 25, 26] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.gitlab/benchmarks.yml b/.gitlab/benchmarks.yml index 3536a06c..b6f580f6 100644 --- a/.gitlab/benchmarks.yml +++ b/.gitlab/benchmarks.yml @@ -37,6 +37,7 @@ benchmarks: - MAJOR_NODE_VERSION: 22 - MAJOR_NODE_VERSION: 24 - MAJOR_NODE_VERSION: 25 + - MAJOR_NODE_VERSION: 26 artifacts: name: "reports" paths: diff --git a/bindings/profilers/wall.cc b/bindings/profilers/wall.cc index c4630ad3..1a5f88a5 100644 --- a/bindings/profilers/wall.cc +++ b/bindings/profilers/wall.cc @@ -135,6 +135,15 @@ class PersistentContextPtr : public node::ObjectWrap { } }; +inline void* GetAlignedPointerFromInternalField(Object* object, int index) { +#if NODE_MAJOR_VERSION >= 26 + return object->GetAlignedPointerFromInternalField( + index, kEmbedderDataTypeTagDefault); +#else + return object->GetAlignedPointerFromInternalField(index); +#endif +} + // Maximum number of rounds in the GetV8ToEpochOffset static constexpr int MAX_EPOCH_OFFSET_ATTEMPTS = 20; @@ -1274,7 +1283,7 @@ ContextPtr WallProfiler::GetContextPtr(Isolate* isolate) { auto wrapObj = reinterpret_cast(wrapValue); if (wrapObj->InternalFieldCount() > 0) { return static_cast( - wrapObj->GetAlignedPointerFromInternalField(0)) + GetAlignedPointerFromInternalField(wrapObj, 0)) ->Get(); } } diff --git a/package-lock.json b/package-lock.json index 085bacf7..39d4a59a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "gts": "^7.0.0", "js-green-licenses": "^4.0.0", "mocha": "^11.7.5", - "nan": "^2.26.2", + "nan": "^2.27.0", "nyc": "^18.0.0", "semver": "^7.8.0", "sinon": "^22.0.0", @@ -4528,9 +4528,9 @@ "license": "ISC" }, "node_modules/nan": { - "version": "2.26.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.26.2.tgz", - "integrity": "sha512-0tTvBTYkt3tdGw22nrAy50x7gpbGCCFH3AFcyS5WiUu7Eu4vWlri1woE6qHBSfy11vksDqkiwjOnlR7WV8G1Hw==", + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.27.0.tgz", + "integrity": "sha512-hC+0LidcL3XE4rp1C4H54KujgXKzbfyTngZTwBByQxsOxCEKZT0MPQ4hOKUH2jU1OYstqdDH4onyHPDzcV0XdQ==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 9eae8e88..333aa8a7 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "gts": "^7.0.0", "js-green-licenses": "^4.0.0", "mocha": "^11.7.5", - "nan": "^2.26.2", + "nan": "^2.27.0", "nyc": "^18.0.0", "semver": "^7.8.0", "sinon": "^22.0.0", From 031aa1204e7cbc96069c03e12524b0a6ceab1e48 Mon Sep 17 00:00:00 2001 From: ishabi Date: Mon, 18 May 2026 15:56:00 +0200 Subject: [PATCH 2/2] remove v26 from benchmark --- .gitlab/benchmarks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab/benchmarks.yml b/.gitlab/benchmarks.yml index b6f580f6..3536a06c 100644 --- a/.gitlab/benchmarks.yml +++ b/.gitlab/benchmarks.yml @@ -37,7 +37,6 @@ benchmarks: - MAJOR_NODE_VERSION: 22 - MAJOR_NODE_VERSION: 24 - MAJOR_NODE_VERSION: 25 - - MAJOR_NODE_VERSION: 26 artifacts: name: "reports" paths: