From cb43dee4ea40d8d7c272fcad2832e55cea69a696 Mon Sep 17 00:00:00 2001 From: xshady <54737754+xxshady@users.noreply.github.com> Date: Mon, 24 Jun 2024 04:22:53 +0300 Subject: [PATCH] fix(shared): unused import callback for enums module --- shared/bindings/BindingsMain.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shared/bindings/BindingsMain.cpp b/shared/bindings/BindingsMain.cpp index 4bd62a42..ac64f040 100644 --- a/shared/bindings/BindingsMain.cpp +++ b/shared/bindings/BindingsMain.cpp @@ -466,9 +466,10 @@ static void GetNetTime(const v8::FunctionCallbackInfo& info) V8_RETURN_UINT(netTime); } -static v8::MaybeLocal HandlePreBootstrapImport(v8::Local context, v8::Local specifier, v8::Local, v8::Local referrer) { +// Enums module doesn't need to import any modules +static v8::MaybeLocal HandleEnumsModuleImport(v8::Local context, v8::Local specifier, v8::Local, v8::Local referrer) { v8::MaybeLocal maybeModule; - Log::Error << "HandlePreBootstrapImport" << Log::Endl; + Log::Error << "Enums module must not import anything" << Log::Endl; return maybeModule; } @@ -485,7 +486,7 @@ static void AddEnumsToSharedModuleExports(v8::Isolate* isolate, v8::Local result = mod->InstantiateModule(ctx, HandlePreBootstrapImport); + v8::Maybe result = mod->InstantiateModule(ctx, HandleEnumsModuleImport); if(result.IsNothing() || result.ToChecked() == false) { Log::Error << "Failed to instantiate js-enums module" << Log::Endl;