-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly remove
!
from definite assignment assertions
Fixes #639 Previously, the `!` operator for class field declarations was not treated as a type token, so it wasn't automatically removed at transpile. In most cases, this wasn't relevant because the class field transform removes uninitialized fields completely. However, there are two cases where it causes an issue: * `disableESTransforms: true`, which disables the class field transform. * Private fields, which are skipped by the class field transform. In both cases, we can fix the issue by just setting the `!` as a type token so that it will naturally get removed by the TS transformer. I also did a little refactoring to pull out the logic for handling individual type tokens.
- Loading branch information
1 parent
018ee1d
commit 0830175
Showing
4 changed files
with
59 additions
and
6 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
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