Skip to content

Commit ca876ad

Browse files
committed
Review notes
1 parent 0b79ed3 commit ca876ad

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lib/internal/modules/esm/hooks.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const {
55
ArrayPrototypePush,
66
FunctionPrototypeCall,
77
ObjectAssign,
8-
ObjectCreate,
98
ObjectDefineProperty,
109
ObjectSetPrototypeOf,
1110
SafeSet,
@@ -255,7 +254,7 @@ class Hooks {
255254
async resolve(
256255
originalSpecifier,
257256
parentURL,
258-
importAssertions = ObjectCreate(null),
257+
importAssertions = { __proto__: null },
259258
) {
260259
const isMain = parentURL === undefined;
261260

@@ -522,7 +521,7 @@ function pluckHooks({
522521
transformSource,
523522
}) {
524523
const obsoleteHooks = [];
525-
const acceptedHooks = ObjectCreate(null);
524+
const acceptedHooks = { __proto__: null };
526525

527526
if (getGlobalPreloadCode) {
528527
globalPreload ??= getGlobalPreloadCode;

lib/internal/modules/esm/load.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function getSource(url, context) {
7070
* @param {object} context
7171
* @returns {object}
7272
*/
73-
async function defaultLoad(url, context) {
73+
async function defaultLoad(url, context = {}) {
7474
let responseURL = url;
7575
const { importAssertions } = context;
7676
let {

lib/internal/modules/esm/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class ESMLoader {
317317
* @param {object} context Metadata about the module
318318
* @returns {Promise<{ format: ModuleFormat, source: ModuleSource }>}
319319
*/
320-
async load(url, context = {}) {
320+
async load(url, context) {
321321
let loadResult;
322322
if (this.#hooks) {
323323
loadResult = await this.#hooks.load(url, context);

0 commit comments

Comments
 (0)