New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: some code and type fixes #4413
Changes from 17 commits
fab28a2
055f4a0
6c812d0
eaada30
a824fa7
14c2638
bdcbe6d
96fe4ac
45deb74
c3dbca6
9d235a0
9cdfc9b
fac5c6a
33446da
c18a0d6
884d34d
b4df2b4
81054ea
587acc8
42b9a55
da6dee6
847fc1a
011bb05
40e396c
c191ac4
60464a3
8183a62
eb0a2c8
20f82aa
5b0c7a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,9 +438,8 @@ export class ModuleLoader { | |
return error(errInternalIdCannotBeExternal(source, importer)); | ||
} | ||
return Promise.resolve(externalModule); | ||
} else { | ||
return this.fetchModule(resolvedId, importer, false, false); | ||
} | ||
return this.fetchModule(resolvedId, importer, false, false); | ||
} | ||
|
||
private async fetchStaticDependencies( | ||
|
@@ -672,13 +671,11 @@ export class ModuleLoader { | |
} as ResolvedId; | ||
} | ||
if (resolution == null) { | ||
return (module.resolvedIds[specifier] = | ||
module.resolvedIds[specifier] || | ||
this.handleResolveId( | ||
await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), | ||
specifier, | ||
module.id | ||
)); | ||
return (module.resolvedIds[specifier] ??= this.handleResolveId( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, down-leveling only adds a tiny amount of additional code which results in almost the same amount without the change. if v3 were about to support node.js v14+ the correct syntax mapping would have been |
||
await this.resolveId(specifier, module.id, EMPTY_OBJECT, false), | ||
specifier, | ||
module.id | ||
)); | ||
} | ||
return this.handleResolveId( | ||
this.getResolvedIdWithDefaults( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the same as it won't do name string deduping in the set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch, thank you! too bad this wasn't caught by a test 😞 I reverted and added a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think it does not change anything at the moment, which is why there is no test. The only situation where you have entries here is if the user used an object as entry point. In that case, the
name
properties are the keys of that object, and object keys deduplicate themselves. It does not hurt either, though.