Repository navigation
Conversation
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.
What
A
SourceMapConsumercreated with a relativeaSourceMapURLcannot resolve the very sources itreports in
consumer.sources._findSourceIndexjoins the query againstsourceRootonly, so a sourcethat the consumer itself already returns is "not found":
README.md:452-454promisessourceContentForworks for every entry ofsourceswhenhasContentsOfAllSources()is true, which it is here.The change
After both existing resolutions miss, accept an exact match against the already-resolved
consumer.sourcesentries (lib/source-map-consumer.js:272-278). Every lookup that worked before goesthrough the same path as before; the fallback only runs where the API previously threw.
Verification
node test/run-tests.js test/test-source-map-consumer.js: 64/65 → 65/65, full suite 190/191 → 191/191;new SourceMapConsumer(map, "maps/app.map")) goes from three failures to passing;sourceRoot×sourceMapURLmatrix passes, confirming the previously working combinationsare untouched;
prettier --checkclean;git apply --checkon a pristinemaster.The new test uses relative URL strings and
async/awaitonly, so it is platform-neutral.No CLA/DCO in the repository.