Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression causing incomplete nullish coalesce in some cases (#610)
Fixes #609 The original implementation of the Jest transform (#540) needed to remove regions of code, but ran into issues with the optional chaining and nullish coalescing transforms, since those transforms would still emit function calls around tokens even if they were removed. The implementation fixed those issues by disabling the optional chaining and nullish coalescing code emit in `removeToken` and `removeInitialToken`. Unfortunately, this broke other cases, like a nullish coalescing call immediately followed by a type token. The nullish coalescing implementation expected `appendTokenSuffix` to be called on the last token even though it was a type token. The changes to `TokenProcessor` actually became unnecessary as of #608 since we no longer are deleting a region of code, so I reverted the two methods back to their original implementation, which fixes the issue.
- Loading branch information