MCPcopy Create free account
hub / github.com/Tracktion/choc / loadDynamicModule

Method loadDynamicModule

choc/javascript/choc_javascript_V8.h:550–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548 {
549 auto path = v8StringToStd (specifier);
550 auto maybeCode = (*currentModuleResolver) (path);
551
552 if (maybeCode)
553 return loadModule (c, stringToV8 (*maybeCode));
554 }
555
556 return {};
557 }
558
559 v8::MaybeLocal<v8::Promise> loadDynamicModule (v8::Local<v8::Context> c,
560 v8::Local<v8::String> specifier)
561 {
562 auto mod = loadStaticModule (c, specifier);
563
564 if (mod.IsEmpty())
565 return {};
566
567 auto result = mod.ToLocalChecked()->Evaluate (c);
568
569 if (result.IsEmpty())
570 return {};
571
572 auto ns = mod.ToLocalChecked()->GetModuleNamespace();

Callers 1

V8ContextMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected