Skip to content

Commit aa3e649

Browse files
authored
esm: update outdated FIXME comment in translators.js
PR-URL: #61715 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent f0be1c0 commit aa3e649

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/modules/esm/translators.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ 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).
147147
const request = { specifier, attributes: importAttributes, phase: kEvaluationPhase, __proto__: null };
148148
const job = cascadedLoader.getOrCreateModuleJob(url, request, kRequireInImportedCJS);
149149
job.runSync();

0 commit comments

Comments
 (0)