| OLD | NEW |
| (Empty) |
| 1 shouldBe("function f() { g()++; } f.toString()", "'function f() { g()++; }'"); | |
| 2 shouldBe("function f() { g()--; } f.toString()", "'function f() { g()--; }'"); | |
| 3 shouldBe("function f() { ++g(); } f.toString()", "'function f() { ++g(); }'"); | |
| 4 shouldBe("function f() { --g(); } f.toString()", "'function f() { --g(); }'"); | |
| 5 shouldBe("function f() { g() = 1; } f.toString()", "'function f() { g() = 1; }'"
); | |
| 6 shouldBe("function f() { g() += 1; } f.toString()", "'function f() { g() += 1; }
'"); | |
| 7 shouldThrow("g()++", "'ReferenceError: Postfix ++ operator applied to value that
is not a reference.'"); | |
| 8 shouldThrow("g()--", "'ReferenceError: Postfix -- operator applied to value that
is not a reference.'"); | |
| 9 shouldThrow("++g()", "'ReferenceError: Prefix ++ operator applied to value that
is not a reference.'"); | |
| 10 shouldThrow("--g()", "'ReferenceError: Prefix -- operator applied to value that
is not a reference.'"); | |
| 11 shouldThrow("g() = 1", "'ReferenceError: Left side of assignment is not a refere
nce.'"); | |
| 12 shouldThrow("g() += 1", "'ReferenceError: Left side of assignment is not a refer
ence.'"); | |
| OLD | NEW |