Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: do not reply on AST extra properties in plugins
- Loading branch information
Showing
11 changed files
with
50 additions
and
25 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
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ var street = user.address?.street | |
street = user.address?.street | ||
|
||
test(a?.b, 1); | ||
test((a?.b), 1); | ||
|
||
(1, a?.b, 2); |
5 changes: 3 additions & 2 deletions
5
packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/containers/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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
var _user$address, _user$address2, _a, _a2; | ||
var _user$address, _user$address2, _a, _a2, _a3; | ||
|
||
var street = (_user$address = user.address) === null || _user$address === void 0 ? void 0 : _user$address.street; | ||
street = (_user$address2 = user.address) === null || _user$address2 === void 0 ? void 0 : _user$address2.street; | ||
test((_a = a) === null || _a === void 0 ? void 0 : _a.b, 1); | ||
1, (_a2 = a) === null || _a2 === void 0 ? void 0 : _a2.b, 2; | ||
test((_a2 = a) === null || _a2 === void 0 ? void 0 : _a2.b, 1); | ||
1, (_a3 = a) === null || _a3 === void 0 ? void 0 : _a3.b, 2; |
7 changes: 7 additions & 0 deletions
7
...osal-optional-chaining/test/fixtures/general/parenthesized-expression-containers/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,7 @@ | ||
var street = user.address?.street | ||
street = user.address?.street | ||
|
||
test(a?.b, 1); | ||
test((a?.b), 1); | ||
|
||
(1, a?.b, 2); |
6 changes: 6 additions & 0 deletions
6
...-optional-chaining/test/fixtures/general/parenthesized-expression-containers/options.json
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,6 @@ | ||
{ | ||
"plugins": ["proposal-optional-chaining"], | ||
"parserOpts": { | ||
"createParenthesizedExpressions": true | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...sal-optional-chaining/test/fixtures/general/parenthesized-expression-containers/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,7 @@ | ||
var _user$address, _user$address2, _a, _a2, _a3; | ||
|
||
var street = (_user$address = user.address) === null || _user$address === void 0 ? void 0 : _user$address.street; | ||
street = (_user$address2 = user.address) === null || _user$address2 === void 0 ? void 0 : _user$address2.street; | ||
test((_a = a) === null || _a === void 0 ? void 0 : _a.b, 1); | ||
test(((_a2 = a) === null || _a2 === void 0 ? void 0 : _a2.b), 1); | ||
((1, (_a3 = a) === null || _a3 === void 0 ? void 0 : _a3.b, 2)); |
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