Skip to content

Commit

Permalink
Simplify a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 5, 2024
1 parent e0bdff9 commit c6152f9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,28 +104,19 @@ static v8::MaybeLocal<v8::Promise> dynamic_module_loader(v8::Local<v8::Context>
return promise;
}

#if V8_VERSION_TOTAL >= 908

static v8::MaybeLocal<v8::Promise> ResolveDynamicModuleCallback(
v8::Local<v8::Context> context,
#if V8_VERSION_TOTAL >= 908
v8::Local<v8::Data> host_defined_options,
v8::Local<v8::Value> resource_name,
v8::Local<v8::String> specifier,
v8::Local<v8::FixedArray> import_assertions) {
return dynamic_module_loader(context, specifier);
}

#else

static v8::MaybeLocal<v8::Promise> ResolveDynamicModuleCallback(
v8::Local<v8::Context> context,
v8::Local<v8::ScriptOrModule> referrer,
#endif
v8::Local<v8::String> specifier,
v8::Local<v8::FixedArray> import_assertions) {
return dynamic_module_loader(context, specifier);
}

#endif

/* Helper fun that compiles JavaScript source code */
static v8::Local<v8::Module> read_module(std::string filename, v8::Local<v8::Context> context){
Expand Down

0 comments on commit c6152f9

Please sign in to comment.