Skip to content

Commit cc7cf1c

Browse files
authored
support Node.js v26 (#327)
* support Node.js v26
1 parent ca6ad29 commit cc7cf1c

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
asan:
1111
strategy:
1212
matrix:
13-
version: [18, 20, 22, 24, 25]
13+
version: [18, 20, 22, 24, 25, 26]
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v3
@@ -23,7 +23,7 @@ jobs:
2323
valgrind:
2424
strategy:
2525
matrix:
26-
version: [18, 20, 22, 24, 25]
26+
version: [18, 20, 22, 24, 25, 26]
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v3

bindings/profilers/wall.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ class PersistentContextPtr : public node::ObjectWrap {
135135
}
136136
};
137137

138+
inline void* GetAlignedPointerFromInternalField(Object* object, int index) {
139+
#if NODE_MAJOR_VERSION >= 26
140+
return object->GetAlignedPointerFromInternalField(
141+
index, kEmbedderDataTypeTagDefault);
142+
#else
143+
return object->GetAlignedPointerFromInternalField(index);
144+
#endif
145+
}
146+
138147
// Maximum number of rounds in the GetV8ToEpochOffset
139148
static constexpr int MAX_EPOCH_OFFSET_ATTEMPTS = 20;
140149

@@ -1274,7 +1283,7 @@ ContextPtr WallProfiler::GetContextPtr(Isolate* isolate) {
12741283
auto wrapObj = reinterpret_cast<Object*>(wrapValue);
12751284
if (wrapObj->InternalFieldCount() > 0) {
12761285
return static_cast<PersistentContextPtr*>(
1277-
wrapObj->GetAlignedPointerFromInternalField(0))
1286+
GetAlignedPointerFromInternalField(wrapObj, 0))
12781287
->Get();
12791288
}
12801289
}

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"gts": "^7.0.0",
5454
"js-green-licenses": "^4.0.0",
5555
"mocha": "^11.7.5",
56-
"nan": "^2.26.2",
56+
"nan": "^2.27.0",
5757
"nyc": "^18.0.0",
5858
"semver": "^7.8.0",
5959
"sinon": "^22.0.0",

0 commit comments

Comments
 (0)