tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / js / script-tests / typeof-syntax.js
1 description(
2 "This test checks whether various forms of typeof expression are allowed."
3 );
4
5 var x = 0;
6 var y = 0;
7
8 shouldBe('typeof x', "'number'");
9 shouldBe('typeof window.x', "'number'");
10 shouldBe('typeof window["x"]', "'number'");
11 shouldBe('typeof (x)', "'number'");
12 shouldBe('typeof (window.x)', "'number'");
13 shouldBe('typeof (window["x"])', "'number'");
14 shouldBe('(y, typeof x)', "'number'");
15 shouldBe('typeof ((x))', "'number'");
16 shouldBe('typeof ((window.x))', "'number'");
17 shouldBe('typeof ((window["x"]))', "'number'");
18 shouldBe('typeof (y, x)', "'number'");
19 shouldBe('typeof (true ? x : y)', "'number'");
20
21 shouldBe('typeof nonexistent', "'undefined'");
22 shouldBe('typeof window.nonexistent', "'undefined'");
23 shouldBe('typeof window["nonexistent"]', "'undefined'");
24 shouldBe('typeof (nonexistent)', "'undefined'");
25 shouldBe('typeof (window.nonexistent)', "'undefined'");
26 shouldBe('typeof (window["nonexistent"])', "'undefined'");