Closed allstarschh closed 2 years ago
I believe this redundancy is just an intentional way of handling the second branch and declaration together to avoid unnecessary verbosity. If you'd like to suggest an editorial edit to explicitly have the else branch that might be an option.
Yes, precisely. This is not really redundant because if the "if" statement is not taken, then the variable still needs to be initialized, so we initialize it in step 3. If we don't overwrite it in step 4.2, this is useful. If we do, then that's fine too.
https://wicg.github.io/import-maps/#parse-an-import-map-string
The first empty map is created here.
https://wicg.github.io/import-maps/#sort-and-normalize-a-specifier-map
Here is the creation of the second empty map, in the sequence (when "imports" exists in import map) The first empty map is redundant.