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 Jan 12, 2023
1 parent 91ca2d4 commit 31ea7be
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 31ea7be

Please sign in to comment.