JSInternalPromise* ModuleLoaderObject::translate(ExecState* exec, JSValue key, JSValue payload) { if (Options::dumpModuleLoadingState()) dataLog("Loader [translate] ", printableModuleKey(exec, key), "\n"); JSGlobalObject* globalObject = exec->lexicalGlobalObject(); if (globalObject->globalObjectMethodTable()->moduleLoaderTranslate) return globalObject->globalObjectMethodTable()->moduleLoaderTranslate(globalObject, exec, key, payload); JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); deferred->resolve(exec, payload); return deferred->promise(); }
JSInternalPromise* ModuleLoaderObject::instantiate(ExecState* exec, JSValue key, JSValue source) { if (Options::dumpModuleLoadingState()) dataLog("Loader [instantiate] ", printableModuleKey(exec, key), "\n"); JSGlobalObject* globalObject = exec->lexicalGlobalObject(); if (globalObject->globalObjectMethodTable()->moduleLoaderInstantiate) return globalObject->globalObjectMethodTable()->moduleLoaderInstantiate(globalObject, exec, key, source); JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); deferred->resolve(exec, jsUndefined()); return deferred->promise(); }
JSInternalPromise* ModuleLoaderObject::resolve(ExecState* exec, JSValue name, JSValue referrer) { if (Options::dumpModuleLoadingState()) dataLog("Loader [resolve] ", printableModuleKey(exec, name), "\n"); JSGlobalObject* globalObject = exec->lexicalGlobalObject(); if (globalObject->globalObjectMethodTable()->moduleLoaderResolve) return globalObject->globalObjectMethodTable()->moduleLoaderResolve(globalObject, exec, name, referrer); JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject); deferred->resolve(exec, name); return deferred->promise(); }