Skip to content

Commit

Permalink
Avoiding FixedArray on Node
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 5, 2024
1 parent c6152f9 commit 0d7f65a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#endif
#endif

#if !defined(ISNODEJS) || NODEJS_LTS_API > 16
#define HasFixedArray
#endif

#if V8_VERSION_TOTAL < 803
#define PerformMicrotaskCheckpoint RunMicrotasks
#endif
Expand Down Expand Up @@ -77,9 +81,10 @@ static void fatal_cb(const char* location, const char* message){

static v8::Local<v8::Module> read_module(std::string filename, v8::Local<v8::Context> context);

static v8::MaybeLocal<v8::Module> ResolveModuleCallback(v8::Local<v8::Context> context,
v8::Local<v8::String> specifier,
v8::Local<v8::FixedArray> import_attributes,
static v8::MaybeLocal<v8::Module> ResolveModuleCallback(v8::Local<v8::Context> context, v8::Local<v8::String> specifier,
#ifdef HasFixedArray
v8::Local<v8::FixedArray> import_arributes,
#endif
v8::Local<v8::Module> referrer) {
v8::String::Utf8Value name(context->GetIsolate(), specifier);
return read_module(*name, context);
Expand Down Expand Up @@ -112,8 +117,11 @@ static v8::MaybeLocal<v8::Promise> ResolveDynamicModuleCallback(
#else
v8::Local<v8::ScriptOrModule> referrer,
#endif
v8::Local<v8::String> specifier,
v8::Local<v8::FixedArray> import_assertions) {
v8::Local<v8::String> specifier
#ifdef HasFixedArray
,v8::Local<v8::FixedArray> import_arributes
#endif
) {
return dynamic_module_loader(context, specifier);
}

Expand Down

0 comments on commit 0d7f65a

Please sign in to comment.