From 463bb9602eff5ca62d9322215c17f733694ec456 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 692ba834631f05..120ab8ccb0beae 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -782,15 +782,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 {{ format: string, url: URL['href'] }} */ - async resolve( - originalSpecifier, - parentURL, - importAssertions = ObjectCreate(null), - ) { + async resolve(originalSpecifier, parentURL, importAssertions) { const isMain = parentURL === undefined; if (