JSInternalPromise* linkAndEvaluateModule(ExecState* exec, const Identifier& moduleKey) { JSLockHolder lock(exec); RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable()); RELEASE_ASSERT(!exec->vm().isCollectorBusy()); JSGlobalObject* globalObject = exec->vmEntryGlobalObject(); return globalObject->moduleLoader()->linkAndEvaluateModule(exec, identifierToJSValue(exec->vm(), moduleKey)); }
JSValue linkAndEvaluateModule(ExecState* exec, const Identifier& moduleKey, JSValue scriptFetcher) { JSLockHolder lock(exec); RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable()); RELEASE_ASSERT(!exec->vm().isCollectorBusyOnCurrentThread()); JSGlobalObject* globalObject = exec->vmEntryGlobalObject(); return globalObject->moduleLoader()->linkAndEvaluateModule(exec, identifierToJSValue(exec->vm(), moduleKey), scriptFetcher); }
AbstractModuleRecord* AbstractModuleRecord::hostResolveImportedModule(ExecState* exec, const Identifier& moduleName) { VM& vm = exec->vm(); auto scope = DECLARE_THROW_SCOPE(vm); JSValue moduleNameValue = identifierToJSValue(vm, moduleName); JSValue entry = m_dependenciesMap->JSMap::get(exec, moduleNameValue); RETURN_IF_EXCEPTION(scope, nullptr); RELEASE_AND_RETURN(scope, jsCast<AbstractModuleRecord*>(entry.get(exec, Identifier::fromString(exec, "module")))); }
static JSInternalPromise* loadModule(const JSLockHolder& lock, ExecState* exec, JSGlobalObject* globalObject, const Identifier& moduleName) { return loadModule(lock, exec, globalObject, identifierToJSValue(exec->vm(), moduleName), jsUndefined()); }