Skip to content
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

Fix emitting real mapping sources when null mapping comes first #4082

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jridgewell
Copy link
Contributor

This fixes an ordering bug when a null mapping and a real mapping share the same sourceIndex. If a null mapping comes first, then we'll assign it a sourceIndexToSourcesIndex but skip recording its source files in the items array because of the isNullEntry check. When we find the real mapping later in results, we'll skip recording its source files because of the map-ok check.

The simplest fix I can think of is flipping the order just a bit. We'll skip assigning sourceIndexToSourcesIndex for null mappings, so that when a real mapping comes up we'll record its sources.

I'm not sure how to generate a unit test case for this, but it resolves the issue found in angular/angular-cli#29465 (comment).

Fixes #4080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source mappings may now contain null entries in 0.24.1 causes errors generate non spec compliant map?
1 participant