Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / postfix-syntax.js
blob260e5da01a76f81ce73e3903d9cc801e048ad720
1 description(
2 "This test checks whether various forms of postincrement expression are allowed."
3 );
5 var x = 0;
6 var y = 0;
8 shouldBe('x++', '0');
9 shouldBe('window.x++', '1');
10 shouldBe('window["x"]++', '2');
11 shouldBe('(x)++', '3');
12 shouldBe('(window.x)++', '4');
13 shouldBe('(window["x"])++', '5');
14 shouldBe('(y, x++)', '6');
15 shouldBe('((x))++', '7');
16 shouldBe('((window.x))++', '8');
17 shouldBe('((window["x"]))++', '9');
19 shouldThrow('(y, x)++');
20 shouldThrow('(true ? x : y)++');
21 shouldThrow('x++++');
23 x = 0;
24 x = x++;
25 shouldBe("x", "0");
27 y = 0;
28 y = y--;
29 shouldBe("y", "0");