Backed out 3 changesets (bug 1901078, bug 1749048) for causing interface related...
[gecko.git] / js / src / tests / non262 / Exceptions / regress-333728.js
blobbf6f4ea34d77688f424b2ebf4b6d9c34dad718d7
1 /* -*- indent-tabs-mode: nil; js-indent-level: 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/. */
6 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 333728;
8 var summary = 'Throw ReferenceErrors for typeof(...undef)';
9 var actual = '';
10 var expect = 'ReferenceError';
12 printBugNumber(BUGNUMBER);
13 printStatus (summary);
15 try
17   actual = typeof (0, undef);
19 catch(ex)
21   actual = ex.name;
24 reportCompare(expect, actual, summary + ': typeof (0, undef)');
26 try
28   actual = typeof (0 || undef);
30 catch(ex)
32   actual = ex.name;
35 reportCompare(expect, actual, summary + ': typeof (0 || undef)');
37 try
39   actual = typeof (1 && undef);
41 catch(ex)
43   actual = ex.name;
46 reportCompare(expect, actual, summary + ': typeof (1 && undef)');
49   try
50   {
51   actual = typeof (0 ? 0 : undef);
52   }
53   catch(ex)
54   {
55   actual = ex.name;
56   }
58   reportCompare(expect, actual, summary + ': typeof (0 ? 0 : undef)');
62   try
63   {
64   actual = typeof (1 ? undef : 0);
65   }
66   catch(ex)
67   {
68   actual = ex.name;
69   }
71   reportCompare(expect, actual, summary + ': typeof (1 ? undef : 0)');
74 try
76   actual = typeof (!this ? 0 : undef);
78 catch(ex)
80   actual = ex.name;
83 reportCompare(expect, actual, summary + ': typeof (!this ? 0 : undef)');