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