diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index 17ddcd639c5550..ee3c80689d1106 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -179,15 +179,15 @@ function nextHookFactory(chain, meta, { validateArgs, validateOutput }) { */ class ESMLoader { #hooks = { - __proto__: null, /** * Prior to ESM loading. These are called once before any modules are started. * @private * @property {KeyedHook[]} globalPreload Last-in-first-out list of preload hooks. */ globalPreload: [], + /** - * Phase 2 of 2 in ESM loading. + * Phase 2 of 2 in ESM loading (phase 2 is below). * @private * @property {KeyedHook[]} load Last-in-first-out collection of loader hooks. */ @@ -197,6 +197,7 @@ class ESMLoader { url: 'node:internal/modules/esm/load', }, ], + /** * Phase 1 of 2 in ESM loading. * @private @@ -412,10 +413,10 @@ class ESMLoader { if (this.#hooks.load.length !== 1) { // We can skip cloning if there are no user-provided loaders because // the Node.js default resolve hook does not use import assertions. - importAssertionsForResolve = ObjectAssign( - { __proto__: null }, - importAssertions, - ); + importAssertionsForResolve = { + __proto__: null, + ...importAssertions, + }; } const { format, url } =