Skip to content

Commit ee92fd3

Browse files
committed
Lint, cleanup
1 parent cd668eb commit ee92fd3

File tree

4 files changed

+2
-22
lines changed

4 files changed

+2
-22
lines changed

lib/internal/modules/esm/hooks.js

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const {
3131
ERR_INVALID_RETURN_VALUE,
3232
ERR_LOADER_CHAIN_INCOMPLETE,
3333
ERR_METHOD_NOT_IMPLEMENTED,
34-
ERR_UNKNOWN_BUILTIN_MODULE,
3534
ERR_WORKER_UNSERIALIZABLE_ERROR,
3635
} = require('internal/errors').codes;
3736
const { exitCodes: { kUnfinishedTopLevelAwait } } = internalBinding('errors');

lib/internal/modules/esm/loader.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ const {
2020
getDefaultConditions,
2121
} = require('internal/modules/esm/utils');
2222
let defaultResolve, defaultLoad, defaultLoadSync, importMetaInitializer;
23-
let debug = require('internal/util/debuglog').debuglog('esm', (fn) => {
24-
debug = fn;
25-
});
2623

2724

2825
function newResolveCache() {
@@ -311,8 +308,7 @@ class ModuleLoader {
311308
async import(specifier, parentURL, importAssertions) {
312309
const moduleJob = await this.getModuleJob(specifier, parentURL, importAssertions);
313310
const { module } = await moduleJob.run();
314-
const namespace = module.getNamespace();
315-
return namespace;
311+
return module.getNamespace();
316312
}
317313

318314
/**

lib/internal/modules/esm/module_job.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ const {
2727
} = require('internal/source_map/source_map_cache');
2828
const assert = require('internal/assert');
2929
const resolvedPromise = PromiseResolve();
30-
let debug = require('internal/util/debuglog').debuglog('esm', (fn) => {
31-
debug = fn;
32-
});
3330

3431
const noop = FunctionPrototype;
3532

@@ -90,7 +87,7 @@ class ModuleJob {
9087
return job.modulePromise;
9188
});
9289

93-
if (promises !== undefined) await SafePromiseAllReturnVoid(promises);
90+
if (promises !== undefined) { await SafePromiseAllReturnVoid(promises); }
9491

9592
return SafePromiseAllReturnArrayLike(dependencyJobs);
9693
};

lib/internal/modules/esm/utils.js

-12
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ const {
2525
getModuleFromWrap,
2626
} = require('internal/vm/module');
2727
const assert = require('internal/assert');
28-
let debug = require('internal/util/debuglog').debuglog('esm', (fn) => {
29-
debug = fn;
30-
});
31-
3228

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

130126
const hooks = new Hooks();
131-
// debug('initializeHooks hooks:', hooks);
132-
// debug('initializeHooks between hooks & esmLoader');
133-
// debug('initializeHooks esmLoader:', esmLoader);
134127
esmLoader.setCustomizations(hooks);
135-
// debug('initializeHooks customization set');
136128

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

149139
const parentURL = pathToFileURL(cwd).href;
150-
// debug('initializeHooks registering hooks relative to', parentURL, customLoaderURLs);
151140
for (let i = 0; i < customLoaderURLs.length; i++) {
152141
await hooks.register(
153142
customLoaderURLs[i],
154143
parentURL,
155144
);
156145
}
157-
debug('initializeHooks finished: hooks', hooks);
158146

159147
return hooks;
160148
}

0 commit comments

Comments
 (0)