Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esm: fix jsdoc type refs to ModuleJobBase in esm/loader #56499

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const { tracingChannel } = require('diagnostics_channel');
const onImport = tracingChannel('module.import');

/**
* @typedef {import('./hooks.js').HooksProxy} HooksProxy
* @typedef {import('./module_job.js').ModuleJobBase} ModuleJobBase
* @typedef {import('url').URL} URL
*/

Expand Down Expand Up @@ -149,6 +151,7 @@ class ModuleLoader {
* to this property and failure to do so will cause undefined
* behavior when invoking `import.meta.resolve`.
* @see {ModuleLoader.setCustomizations}
* @type {CustomizedModuleLoader}
*/
#customizations;

Expand Down Expand Up @@ -202,7 +205,7 @@ class ModuleLoader {
*
* Calling this function alters how modules are loaded and should be
* invoked with care.
* @param {object} customizations
* @param {CustomizedModuleLoader} customizations
*/
setCustomizations(customizations) {
this.#customizations = customizations;
Expand Down Expand Up @@ -270,7 +273,7 @@ class ModuleLoader {
* @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 {ImportAttributes} importAttributes Attributes from the import statement or expression.
* @returns {Promise<ModuleJobBase}
* @returns {Promise<ModuleJobBase>}
*/
async getModuleJobForImport(specifier, parentURL, importAttributes) {
const resolveResult = await this.resolve(specifier, parentURL, importAttributes);
Expand All @@ -284,7 +287,7 @@ class ModuleLoader {
* @param {string} specifier See {@link getModuleJobForImport}
* @param {string} [parentURL] See {@link getModuleJobForImport}
* @param {ImportAttributes} importAttributes See {@link getModuleJobForImport}
* @returns {Promise<ModuleJobBase}
* @returns {Promise<ModuleJobBase>}
*/
getModuleJobForRequireInImportedCJS(specifier, parentURL, importAttributes) {
const resolveResult = this.resolveSync(specifier, parentURL, importAttributes);
Expand Down Expand Up @@ -678,7 +681,7 @@ class ModuleLoader {
/**
* Similar to {@link resolve}, but the results are always synchronously returned. If there are any
* asynchronous resolve hooks from module.register(), it will block until the results are returned
* from the loader thread for this to be synchornous.
* from the loader thread for this to be synchronous.
* This is here to support `import.meta.resolve()`, `require()` in imported CJS, and
* `module.registerHooks()` hooks.
*
Expand Down
Loading