Skip to content

module: cache synchronous module jobs before linking

test: add common.expectRequiredModule()

To minimize changes if/when we change the layout of the result returned by require(esm).

module: cache synchronous module jobs before linking

So that if there are circular dependencies in the synchronous module graph, they could be resolved using the cached jobs. In case linking fails and the error gets caught, reset the cache right after linking. If it succeeds, the caller will cache it again. Otherwise the error bubbles up to users, and since we unset the cache for the unlinkable module the next attempt would still fail.

Fixes: https://github.com/nodejs/node/issues/52864

Merge request reports

Loading