Added condition for '+' case. (#13115)

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
This commit is contained in:
t-mangoeandSosuke Suzuki authored and GitHub committed 2022-08-08 01:08:28 +08:00
1 parent 67efa96da6
commit 00ec91bfde
3 files changed
+54 -1

No files matched your search

+18 -1
View File
@@ -883,9 +883,26 @@ function isSimpleCallArgument(node, depth) {
);
}
const targetUnaryExpressionOperators = {
"!": true,
"-": true,
"+": true,
"~": true,
};
if (
node.type === "UnaryExpression" &&
(node.operator === "!" || node.operator === "-")
targetUnaryExpressionOperators[node.operator]
) {
return isSimpleCallArgument(node.argument, depth);
}
const targetUpdateExpressionOperators = {
"++": true,
"--": true,
};
if (
node.type === "UpdateExpression" &&
targetUpdateExpressionOperators[node.operator]
) {
return isSimpleCallArgument(node.argument, depth);
}