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: update lineMap after altering source.text #2837

Merged
merged 2 commits into from
May 27, 2021
Merged

Conversation

lzhoucs
Copy link
Contributor

@lzhoucs lzhoucs commented May 13, 2021

Fixes #2680.

I debugged through the compilation process and found that source.lineMap never gets recomputed after source.text is updated. This causes wrong source lines getting mapped into 3rd field of each segment(a.k.a the line in the original source, see spec for more details) when the sourcemap is generated against out dated lineMap.

Here is an example before the fix:
image

And here is after the fix:
image


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mergify
Copy link
Contributor

mergify bot commented May 13, 2021

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@lzhoucs lzhoucs changed the title Update lineMap after altering source.text fix: update lineMap after altering source.text May 13, 2021
@RomainMuller
Copy link
Contributor

@all-contributors add lzhoucs for bugs, code

@allcontributors
Copy link
Contributor

@RomainMuller

I've put up a pull request to add @lzhoucs! 🎉

@mergify
Copy link
Contributor

mergify bot commented May 26, 2021

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label May 26, 2021
@mergify
Copy link
Contributor

mergify bot commented May 26, 2021

Merging (with squash)...

@RomainMuller RomainMuller merged commit 137bb19 into aws:main May 27, 2021
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label May 27, 2021
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.

Bug: inline sourcemaps are broken
2 participants