Debian Codegraph @

rhino/testsrc/tests/js1_5/Exceptions/regress-333728.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-333728.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 333728;
9 var summary = 'Throw ReferenceErrors for typeof(...undef)';
10 var actual = '';
11 var expect = 'ReferenceError';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 try
17 {
18 actual = typeof (0, undef);
19 }
20 catch(ex)
21 {
22 actual = ex.name;
23 }
24
25 reportCompare(expect, actual, summary + ': typeof (0, undef)');
26
27 try
28 {
29 actual = typeof (0 || undef);
30 }
31 catch(ex)
32 {
33 actual = ex.name;
34 }
35
36 reportCompare(expect, actual, summary + ': typeof (0 || undef)');
37
38 try
39 {
40 actual = typeof (1 && undef);
41 }
42 catch(ex)
43 {
44 actual = ex.name;
45 }
46
47 reportCompare(expect, actual, summary + ': typeof (1 && undef)');
48
49 /*
50 try
51 {
52 actual = typeof (0 ? 0 : undef);
53 }
54 catch(ex)
55 {
56 actual = ex.name;
57 }
58
59 reportCompare(expect, actual, summary + ': typeof (0 ? 0 : undef)');
60 */
61
62 /*
63 try
64 {
65 actual = typeof (1 ? undef : 0);
66 }
67 catch(ex)
68 {
69 actual = ex.name;
70 }
71
72 reportCompare(expect, actual, summary + ': typeof (1 ? undef : 0)');
73 */
74
75 try
76 {
77 actual = typeof (!this ? 0 : undef);
78 }
79 catch(ex)
80 {
81 actual = ex.name;
82 }
83
84 reportCompare(expect, actual, summary + ': typeof (!this ? 0 : undef)');