Skip to content

Commit 62f50d0

Browse files
committed
Added position to replacement binary expression for binary assignment operators
1 parent 89ae1d2 commit 62f50d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Transpiler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,11 @@ export abstract class LuaTranspiler {
819819
// Check if this is an assignment token, then handle accordingly
820820
const [isAssignment, operator] = tsHelper.isBinaryAssignmentToken(node.operatorToken.kind);
821821
if (isAssignment) {
822+
const binaryExpression = ts.createBinary(node.left, operator, node.right);
823+
binaryExpression.pos = node.operatorToken.pos;
822824
return this.transpileAssignmentExpression(
823825
node.left,
824-
ts.createBinary(node.left, operator, node.right),
826+
binaryExpression,
825827
tsHelper.isExpressionStatement(node),
826828
false
827829
);

0 commit comments

Comments
 (0)