LambdaS5
LambdaS5 copied to clipboard
Improper handling of compound assignment
S5 desugars compound assignment (e1 += e2 etc.) to e1 = e1 + e2, which is invalid when the evaluation of e1 has side effects. Here is an example program that exhibits the problem:
var o = {x: 0};
function f() { o.x++; return o };
(f()).x += 1
Complying implementations should give o.x == 2. S5 gives 3, because under the current desugaring, f() is called twice.