Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup default arg
  • Loading branch information
guybedford authored and GeoffreyBooth committed Aug 13, 2023
commit c94c64ea8ee509bd19fed79ac7e4b03135901028
8 changes: 4 additions & 4 deletions lib/internal/modules/esm/initialize_import_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function createImportMetaResolve(defaultParentURL, loader, allowParentURL) {
* @param {URL['href']} [parentURL] When `--experimental-import-meta-resolve` is specified, a
* second argument can be provided.
*/
return function resolve(specifier) {
return function resolve(specifier, parentURL = defaultParentURL) {
let url;

const parentURL = allowParentURL ?
arguments[1] ?? defaultParentURL :
defaultParentURL;
if (!allowParentURL) {
parentURL = defaultParentURL;
}

try {
({ url } = loader.resolveSync(specifier, parentURL));
Expand Down