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

Commit

Permalink
Fix: Ensure exp. operator assignment is AssignmentExpression (fixes #355
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JamesHenry committed Aug 16, 2017
1 parent 67971de commit 6b704c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,13 @@ module.exports = function convert(config) {
result.expressions.push(right);
}

} else if (node.operatorToken && node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) {
Object.assign(result, {
type: AST_NODE_TYPES.AssignmentExpression,
operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind),
left: convertChild(node.left),
right: convertChild(node.right)
});
} else {
Object.assign(result, {
type: nodeUtils.getBinaryExpressionType(node.operatorToken),
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/__snapshots__/ecma-features.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65558,7 +65558,7 @@ Object {
"type": "Literal",
"value": 4,
},
"type": "BinaryExpression",
"type": "AssignmentExpression",
},
"loc": Object {
"end": Object {
Expand Down

0 comments on commit 6b704c9

Please sign in to comment.