Skip to content

Commit

Permalink
fix(shared): unused import callback for enums module
Browse files Browse the repository at this point in the history
  • Loading branch information
xxshady authored Jun 24, 2024
1 parent 0219405 commit cb43dee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shared/bindings/BindingsMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,10 @@ static void GetNetTime(const v8::FunctionCallbackInfo<v8::Value>& info)
V8_RETURN_UINT(netTime);
}

static v8::MaybeLocal<v8::Module> HandlePreBootstrapImport(v8::Local<v8::Context> context, v8::Local<v8::String> specifier, v8::Local<v8::FixedArray>, v8::Local<v8::Module> referrer) {
// Enums module doesn't need to import any modules
static v8::MaybeLocal<v8::Module> HandleEnumsModuleImport(v8::Local<v8::Context> context, v8::Local<v8::String> specifier, v8::Local<v8::FixedArray>, v8::Local<v8::Module> referrer) {
v8::MaybeLocal<v8::Module> maybeModule;
Log::Error << "HandlePreBootstrapImport" << Log::Endl;
Log::Error << "Enums module must not import anything" << Log::Endl;
return maybeModule;
}

Expand All @@ -485,7 +486,7 @@ static void AddEnumsToSharedModuleExports(v8::Isolate* isolate, v8::Local<v8::Co
}

auto mod = maybeModule.ToLocalChecked();
v8::Maybe<bool> result = mod->InstantiateModule(ctx, HandlePreBootstrapImport);
v8::Maybe<bool> result = mod->InstantiateModule(ctx, HandleEnumsModuleImport);
if(result.IsNothing() || result.ToChecked() == false)
{
Log::Error << "Failed to instantiate js-enums module" << Log::Endl;
Expand Down

0 comments on commit cb43dee

Please sign in to comment.