@@ -446,10 +446,6 @@ module TexprFilter = struct
| TLocal v2 when v1 == v2 && not !affected ->
found := true;
e1
- | TBinop((OpAssign | OpAssignOp _ as op),e1,e2) ->
- let e2 = replace e2 in
- let e1 = replace e1 in
- {e with eexpr = TBinop(op,e1,e2)}
| TCall({eexpr = TLocal v},_) when is_unbound v ->
e
| _ ->
@@ -539,6 +539,17 @@ class TestJs {
inlineCall(inlineCall(call(1, 2), stringField), inlineCall(stringField, call(5, 6)));
}
+ @:js('
+ var i = TestJs.getInt();
+ var a = TestJs.getArray();
+ a[i++] = i++;
+ ')
+ static function testAssignmentSideEffect() {
+ var i = getInt();
+ var a = getArray();
+ }
+
static inline function inlineCall(d1:Dynamic, d2:Dynamic) {
return call(d2, d1);