Skip to content

Commit 54a94bc

Browse files
authored
feat: 新增SequenceExpression支持 (#625)
1 parent c4d6910 commit 54a94bc

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

src/Plugin.js

+7
Original file line numberDiff line numberDiff line change
@@ -294,4 +294,11 @@ export default class Plugin {
294294
const { node } = path;
295295
this.buildExpressionHandler(node, ['superClass'], path, state);
296296
}
297+
298+
SequenceExpression(path, state) {
299+
const { node } = path;
300+
301+
const expressionsProps = node.expressions.map((_, index) => index);
302+
this.buildExpressionHandler(node.expressions, expressionsProps, path, state);
303+
}
297304
}

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export default function ({ types }) {
101101
'ClassDeclaration',
102102
'SwitchStatement',
103103
'SwitchCase',
104+
'SequenceExpression',
104105
];
105106

106107
const ret = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Button } from 'antd';
2+
3+
(true, Button);
4+
5+
true ? (true, Button) : (false, Button);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"use strict";
2+
3+
var _button = _interopRequireDefault(require("antd/lib/button"));
4+
5+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6+
7+
true, _button.default;
8+
9+
true ? (true, _button.default) : (false, _button.default);

0 commit comments

Comments
 (0)