Skip to content

Commit 38def9c

Browse files
nsavoireszegedi
andcommitted
Node 24 support (#207)
* Add support for Node 24. Remove support for Node 16. * Fix for Node 24 --------- Co-authored-by: Attila Szegedi <attila.szegedi@datadoghq.com>
1 parent 050543d commit 38def9c

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

.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: [16, 18, 20, 22, 23]
13+
version: [18, 20, 22, 24]
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: [16, 18, 20, 22, 23]
26+
version: [18, 20, 22, 24]
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v3

.gitlab/benchmarks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ benchmarks:
3232
- ./steps/run-benchmarks.sh
3333
parallel:
3434
matrix:
35-
- MAJOR_NODE_VERSION: 16
3635
- MAJOR_NODE_VERSION: 18
3736
- MAJOR_NODE_VERSION: 20
3837
- MAJOR_NODE_VERSION: 22
38+
# TODO: Re-enable this once supports for Node 24 is merged on main
39+
# - MAJOR_NODE_VERSION: 24
3940
artifacts:
4041
name: "reports"
4142
paths:

bindings/profilers/wall.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ NAN_METHOD(WallProfiler::New) {
671671

672672
NAN_METHOD(WallProfiler::Start) {
673673
WallProfiler* wallProfiler =
674-
Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
674+
Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
675675

676676
if (info.Length() != 0) {
677677
return Nan::ThrowTypeError("Start must not have any arguments.");
@@ -766,7 +766,7 @@ NAN_METHOD(WallProfiler::Stop) {
766766
bool restart = info[0].As<Boolean>()->Value();
767767

768768
WallProfiler* wallProfiler =
769-
Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
769+
Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
770770

771771
v8::Local<v8::Value> profile;
772772
auto err = wallProfiler->StopImpl(restart, profile);
@@ -996,27 +996,27 @@ void WallProfiler::SetContext(Isolate* isolate, Local<Value> value) {
996996
}
997997

998998
NAN_GETTER(WallProfiler::GetContext) {
999-
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
999+
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
10001000
info.GetReturnValue().Set(profiler->GetContext(info.GetIsolate()));
10011001
}
10021002

10031003
NAN_SETTER(WallProfiler::SetContext) {
1004-
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
1004+
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
10051005
profiler->SetContext(info.GetIsolate(), value);
10061006
}
10071007

10081008
NAN_GETTER(WallProfiler::SharedArrayGetter) {
1009-
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
1009+
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
10101010
info.GetReturnValue().Set(profiler->jsArray_.Get(v8::Isolate::GetCurrent()));
10111011
}
10121012

10131013
NAN_METHOD(WallProfiler::V8ProfilerStuckEventLoopDetected) {
1014-
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
1014+
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
10151015
info.GetReturnValue().Set(profiler->v8ProfilerStuckEventLoopDetected());
10161016
}
10171017

10181018
NAN_METHOD(WallProfiler::Dispose) {
1019-
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
1019+
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.This());
10201020
delete profiler;
10211021
}
10221022

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@
8383
},
8484
"engines": {
8585
"node": ">=16"
86-
}
86+
},
87+
"//": "Temporary fix to make nan@2.22.2 work with Node 24",
88+
"postinstall": "sed -i '' 's/^.* Holder() const.*//' ./node_modules/nan/nan_callbacks_12_inl.h"
8789
}

0 commit comments

Comments
 (0)