Skip to content

Commit

Permalink
Fix for (undefined) NODEJS_LTS_API 20
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 12, 2024
1 parent 679e5e0 commit 9215ec2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#define NODEJS_LTS_API 18
#elif V8_MAJOR_VERSION == 9
#define NODEJS_LTS_API 16
#elif V8_MAJOR_VERSION == 8
#elif V8_MAJOR_VERSION < 9
#define NODEJS_LTS_API 14
#endif
#endif

#if !defined(ISNODEJS) || NODEJS_LTS_API > 16
#define FixedArrayParam ,v8::Local<v8::FixedArray> import_arributes
#else
#if defined(NODEJS_LTS_API) && NODEJS_LTS_API < 18
#define FixedArrayParam
#else
#define FixedArrayParam ,v8::Local<v8::FixedArray> import_arributes
#endif

#if V8_VERSION_TOTAL < 803
Expand Down Expand Up @@ -129,11 +129,11 @@ static v8::MaybeLocal<v8::Promise> ResolveDynamicModuleCallback(
}

static v8::ScriptOrigin make_origin(std::string filename){
#if defined(ISNODEJS) && NODEJS_LTS_API < 18
#if defined(NODEJS_LTS_API) && NODEJS_LTS_API < 18
return v8::ScriptOrigin(ToJSString( filename.c_str()), v8::Integer::New(isolate, 0),
v8::Integer::New(isolate, 0), v8::False(isolate), v8::Local<v8::Integer>(),
v8::Local<v8::Value>(), v8::False(isolate), v8::False(isolate), v8::True(isolate));
#elif V8_VERSION_TOTAL < 1201
#elif V8_VERSION_TOTAL < 1201 || NODEJS_LTS_API == 20
return v8::ScriptOrigin(isolate,ToJSString( filename.c_str()), 0, 0, false, -1,
v8::Local<v8::Value>(), false, false, true);
#else
Expand Down

0 comments on commit 9215ec2

Please sign in to comment.