From 31ea7be98df5b2648a966afeb6a08006f7ba5de3 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 12 Jan 2023 22:11:11 +0100 Subject: [PATCH] esm: mark `importAssertions` as required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already always specify a value, and failing to do so would likely be a bug. PR-URL: https://github.com/nodejs/node/pull/46164 Reviewed-By: Geoffrey Booth Reviewed-By: Michaƫl Zasso --- lib/internal/modules/esm/loader.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index 751fb696ada7bb..c1b71bfc3af031 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -299,15 +299,11 @@ class ESMLoader { * @param {string} originalSpecifier The specified URL path of the module to * be resolved. * @param {string} [parentURL] The URL path of the module's parent. - * @param {ImportAssertions} [importAssertions] Assertions from the import + * @param {ImportAssertions} importAssertions Assertions from the import * statement or expression. * @returns {Promise<{ format: string, url: URL['href'] }>} */ - async resolve( - originalSpecifier, - parentURL, - importAssertions = { __proto__: null }, - ) { + async resolve(originalSpecifier, parentURL, importAssertions) { if (this.#hooks) { return this.#hooks.resolve(originalSpecifier, parentURL, importAssertions); }