Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 6b704c9

Browse files
committed
Fix: Ensure exp. operator assignment is AssignmentExpression (fixes #355)
1 parent 67971de commit 6b704c9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/convert.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,13 @@ module.exports = function convert(config) {
14611461
result.expressions.push(right);
14621462
}
14631463

1464+
} else if (node.operatorToken && node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) {
1465+
Object.assign(result, {
1466+
type: AST_NODE_TYPES.AssignmentExpression,
1467+
operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind),
1468+
left: convertChild(node.left),
1469+
right: convertChild(node.right)
1470+
});
14641471
} else {
14651472
Object.assign(result, {
14661473
type: nodeUtils.getBinaryExpressionType(node.operatorToken),

tests/lib/__snapshots__/ecma-features.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65558,7 +65558,7 @@ Object {
6555865558
"type": "Literal",
6555965559
"value": 4,
6556065560
},
65561-
"type": "BinaryExpression",
65561+
"type": "AssignmentExpression",
6556265562
},
6556365563
"loc": Object {
6556465564
"end": Object {

0 commit comments

Comments
 (0)