-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix transform of
delete a?.b
in function params (#15739)
* Refactor optional chain transform to split `?.` logic from expr type * Fix transform of `delete a?.b` in function params
- Loading branch information
1 parent
4596fe1
commit 2952d76
Showing
3 changed files
with
102 additions
and
65 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
1 change: 1 addition & 0 deletions
1
...ugin-transform-optional-chaining/test/fixtures/general/delete-in-function-params/input.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function f(x = delete a()?.b) {} |
4 changes: 4 additions & 0 deletions
4
...gin-transform-optional-chaining/test/fixtures/general/delete-in-function-params/output.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function f(x = (() => { | ||
var _a; | ||
return (_a = a()) === null || _a === void 0 ? true : delete _a.b; | ||
})()) {} |