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/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",