Skip to content

Commit

Permalink
esm: mark importAssertions as required
Browse files Browse the repository at this point in the history
We already always specify a value, and failing to do so would likely be
a bug.

PR-URL: #46164
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
aduh95 authored and juanarbol committed Jan 31, 2023
1 parent e620de6 commit 463bb96
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/internal/modules/esm/loader.js
Expand Up @@ -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 (
Expand Down

0 comments on commit 463bb96

Please sign in to comment.