Skip to content

Commit

Permalink
CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobJingleheimer committed Sep 18, 2022
1 parent e52919f commit b047e56
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/internal/modules/esm/loader.js
Expand Up @@ -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.
*/
Expand All @@ -197,6 +197,7 @@ class ESMLoader {
url: 'node:internal/modules/esm/load',
},
],

/**
* Phase 1 of 2 in ESM loading.
* @private
Expand Down Expand Up @@ -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 } =
Expand Down

0 comments on commit b047e56

Please sign in to comment.