* Resolve a module request to a URL identifying the location of the module. Handles customization hooks, * if any. * @param {string} [parentURL] The URL of the module where the module request is initiated. * It's undefined if it's from the root module. * @param {ModuleRequest} request
(parentURL, request)
| 676 | * @returns {Promise<ResolveResult>|ResolveResult} |
| 677 | */ |
| 678 | #resolve(parentURL, request) { |
| 679 | if (this.isForAsyncLoaderHookWorker) { |
| 680 | const specifier = `${request.specifier}`; |
| 681 | const importAttributes = request.attributes ?? kEmptyObject; |
| 682 | // TODO(joyeecheung): invoke the synchronous hooks in the default step on loader thread. |
| 683 | return this.#asyncLoaderHooks.resolve(specifier, parentURL, importAttributes); |
| 684 | } |
| 685 | |
| 686 | return this.resolveSync(parentURL, request); |
| 687 | } |
| 688 | |
| 689 | /** |
| 690 | * Either return a cached resolution, or perform the default resolution which is synchronous, and |
no test coverage detected