Skip to content

Commit

Permalink
Lint, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Sep 3, 2023
1 parent cd668eb commit ee92fd3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 22 deletions.
1 change: 0 additions & 1 deletion lib/internal/modules/esm/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const {
ERR_INVALID_RETURN_VALUE,
ERR_LOADER_CHAIN_INCOMPLETE,
ERR_METHOD_NOT_IMPLEMENTED,
ERR_UNKNOWN_BUILTIN_MODULE,
ERR_WORKER_UNSERIALIZABLE_ERROR,
} = require('internal/errors').codes;
const { exitCodes: { kUnfinishedTopLevelAwait } } = internalBinding('errors');
Expand Down
6 changes: 1 addition & 5 deletions lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const {
getDefaultConditions,
} = require('internal/modules/esm/utils');
let defaultResolve, defaultLoad, defaultLoadSync, importMetaInitializer;
let debug = require('internal/util/debuglog').debuglog('esm', (fn) => {
debug = fn;
});


function newResolveCache() {
Expand Down Expand Up @@ -311,8 +308,7 @@ class ModuleLoader {
async import(specifier, parentURL, importAssertions) {
const moduleJob = await this.getModuleJob(specifier, parentURL, importAssertions);
const { module } = await moduleJob.run();
const namespace = module.getNamespace();
return namespace;
return module.getNamespace();
}

/**
Expand Down
5 changes: 1 addition & 4 deletions lib/internal/modules/esm/module_job.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const {
} = require('internal/source_map/source_map_cache');
const assert = require('internal/assert');
const resolvedPromise = PromiseResolve();
let debug = require('internal/util/debuglog').debuglog('esm', (fn) => {
debug = fn;
});

const noop = FunctionPrototype;

Expand Down Expand Up @@ -90,7 +87,7 @@ class ModuleJob {
return job.modulePromise;
});

if (promises !== undefined) await SafePromiseAllReturnVoid(promises);
if (promises !== undefined) { await SafePromiseAllReturnVoid(promises); }

return SafePromiseAllReturnArrayLike(dependencyJobs);
};
Expand Down
12 changes: 0 additions & 12 deletions lib/internal/modules/esm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ const {
getModuleFromWrap,
} = require('internal/vm/module');
const assert = require('internal/assert');
let debug = require('internal/util/debuglog').debuglog('esm', (fn) => {
debug = fn;
});


const callbackMap = new SafeWeakMap();
function setCallbackForWrap(wrap, data) {
Expand Down Expand Up @@ -128,11 +124,7 @@ async function initializeHooks() {
const esmLoader = require('internal/process/esm_loader').esmLoader;

const hooks = new Hooks();
// debug('initializeHooks hooks:', hooks);
// debug('initializeHooks between hooks & esmLoader');
// debug('initializeHooks esmLoader:', esmLoader);
esmLoader.setCustomizations(hooks);
// debug('initializeHooks customization set');

// We need the loader customizations to be set _before_ we start invoking
// `--require`, otherwise loops can happen because a `--require` script
Expand All @@ -142,19 +134,15 @@ async function initializeHooks() {
// N.B. This block appears here specifically in order to ensure that
// `--require` calls occur before `--loader` ones do.
loadPreloadModules();
// debug('initializeHooks loaded preload modules');
initializeFrozenIntrinsics();
// debug('initializeHooks Frozen Intrinsics initialized');

const parentURL = pathToFileURL(cwd).href;
// debug('initializeHooks registering hooks relative to', parentURL, customLoaderURLs);
for (let i = 0; i < customLoaderURLs.length; i++) {
await hooks.register(
customLoaderURLs[i],
parentURL,
);
}
debug('initializeHooks finished: hooks', hooks);

return hooks;
}
Expand Down

0 comments on commit ee92fd3

Please sign in to comment.