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: silence magic-string warnings and update usage #571

Merged
merged 1 commit into from Nov 27, 2016

Conversation

alangpierce
Copy link
Member

magic-string 0.17.0 deprecated insertLeft and insertRight in favor of more
precise prepend/append names. See this issue for a discussion on that:
Rich-Harris/magic-string#109

To silence that warning, this commit moves the code to the new API, which was
pretty easy because there are only a few call sites.

I also cleaned up that part of NodePatcher, which didn't make a lot of sense.
Now, instead of NodePatcher.insert calling NodePatcher.insertRight calling
MagicString.insertLeft and NodePatcher.insertLeft being unused, we just
have NodePatcher.insert calling MagicString.appendLeft. At least for now, I
think it's best to always use the same insert method so that inserts go in
order.

I also changed insertRight to appendRight in one case because it probably makes
more sense anyway and the tests pass.

magic-string 0.17.0 deprecated insertLeft and insertRight in favor of more
precise prepend/append names. See this issue for a discussion on that:
Rich-Harris/magic-string#109

To silence that warning, this commit moves the code to the new API, which was
pretty easy because there are only a few call sites.

I also cleaned up that part of `NodePatcher`, which didn't make a lot of sense.
Now, instead of `NodePatcher.insert` calling `NodePatcher.insertRight` calling
`MagicString.insertLeft` and `NodePatcher.insertLeft` being unused, we just
have `NodePatcher.insert` calling `MagicString.appendLeft`. At least for now, I
think it's best to always use the same insert method so that inserts go in
order.

I also changed insertRight to appendRight in one case because it probably makes
more sense anyway and the tests pass.
@alangpierce alangpierce merged commit 969cb08 into decaffeinate:master Nov 27, 2016
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.

None yet

2 participants