Skip to content

Commit f034a65

Browse files
committed
esm: update outdated FIXME comment in translators.js
1 parent 3ab9dd8 commit f034a65

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/internal/modules/esm/translators.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ function loadCJSModule(module, source, url, filename, isMain) {
142142
specifier = `${pathToFileURL(path)}`;
143143
}
144144

145-
// FIXME(node:59666) Currently, the ESM loader re-invents require() here for imported CJS and this
146-
// requires a separate cache to be populated as well as introducing several quirks. This is not ideal.
145+
// NOTE: This re-invented require() is only used on the loader-hook worker thread.
146+
// On the main thread, the authentic require() is used instead (fixed by #60380).
147+
// Remaining quirks on the loader-hook thread: lacks require.cache, require.extensions.
147148
const request = { specifier, attributes: importAttributes, phase: kEvaluationPhase, __proto__: null };
148149
const job = cascadedLoader.getOrCreateModuleJob(url, request, kRequireInImportedCJS);
149150
job.runSync();

0 commit comments

Comments
 (0)