Fix merge existing and new import maps - reversed operands#12167
Open
yoavweiss wants to merge 1 commit intowhatwg:mainfrom
Open
Fix merge existing and new import maps - reversed operands#12167yoavweiss wants to merge 1 commit intowhatwg:mainfrom
yoavweiss wants to merge 1 commit intowhatwg:mainfrom
Conversation
…maps In the 'merge existing and new import maps' algorithm, step 6.1.1 checked if `specifier` (from newImportMapImports) starts with `record`'s specifier (from the resolved module set). This is backwards — the check should be whether the resolved module's specifier starts with the new import map's specifier, to correctly detect when a new import map rule could impact an already-resolved module. For example, if 'resources/log.js' has already been resolved and a new import map adds a mapping for 'resources/', the algorithm should detect that 'resources/log.js' starts with 'resources/' and remove the new rule. The previous order checked if 'resources/' starts with 'resources/log.js', which is always false. Fixes whatwg#11875
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As #11875 points out, the operants in 'merge existing and new import maps' algorithm, step 6.1.1 are reversed. This changes them to be in the right order.
Fixes #11875
As this is a spec bug fix, the below checks are not relevant.
(See WHATWG Working Mode: Changes for more details.)
/webappapis.html ( diff )