Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change overwrite and remove to remove interior inserts
This changes the `overwrite` and `remove` behavior to be consistent with `move` and `slice`: the specified range includes any `insertRight`s on the left side and any `insertLeft`s on the right side. The code change ended up actually making the code simpler: `Chunk.edit` now overwrites all chunk content, including the intro and outro, so the `overwrite` code doesn't need to be careful about clearing the intro and outro for specific chunks. This fixes decaffeinate/decaffeinate#269 . See my comment in that bug for an explanation of what was going wrong, and why this case is important. In addition to this passing all of the magic-string tests, I also ran all of the decaffeinate tests with this change and they all pass. So at least with the decaffeinate project, the code wasn't depending on the previous behavior.
- Loading branch information
1 parent
e930c5a
commit 3f6dd4d
Showing
3 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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