only mark LHS as modified in assignments

This commit is contained in:
alexlamsl 2016-09-21 00:23:56 +08:00
parent 8646b15314
commit 5ad6a0e2ca

View File

@ -220,7 +220,8 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
} }
} }
node.thedef = sym; node.thedef = sym;
if (parent instanceof AST_Assign || parent instanceof AST_Unary && (parent.operator === '++' || parent.operator === '--')) { if (parent instanceof AST_Unary && (parent.operator === '++' || parent.operator === '--')
|| parent instanceof AST_Assign && parent.left === node) {
sym.modified = true; sym.modified = true;
} }
node.reference(); node.reference();