From f034a65a498631b68869ab384800ed1e1c88ad63 Mon Sep 17 00:00:00 2001 From: Karan Mangtani Date: Sat, 7 Feb 2026 14:30:59 +0530 Subject: [PATCH] esm: update outdated FIXME comment in translators.js --- lib/internal/modules/esm/translators.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 74e90edb5b3a72..9310878de0833d 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -142,8 +142,9 @@ function loadCJSModule(module, source, url, filename, isMain) { specifier = `${pathToFileURL(path)}`; } - // FIXME(node:59666) Currently, the ESM loader re-invents require() here for imported CJS and this - // requires a separate cache to be populated as well as introducing several quirks. This is not ideal. + // NOTE: This re-invented require() is only used on the loader-hook worker thread. + // On the main thread, the authentic require() is used instead (fixed by #60380). + // Remaining quirks on the loader-hook thread: lacks require.cache, require.extensions. const request = { specifier, attributes: importAttributes, phase: kEvaluationPhase, __proto__: null }; const job = cascadedLoader.getOrCreateModuleJob(url, request, kRequireInImportedCJS); job.runSync();