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)';
10 var expect = 'ReferenceError';
12 printBugNumber(BUGNUMBER);
13 printStatus (summary);
17 actual = typeof (0, undef);
24 reportCompare(expect, actual, summary + ': typeof (0, undef)');
28 actual = typeof (0 || undef);
35 reportCompare(expect, actual, summary + ': typeof (0 || undef)');
39 actual = typeof (1 && undef);
46 reportCompare(expect, actual, summary + ': typeof (1 && undef)');
51 actual = typeof (0 ? 0 : undef);
58 reportCompare(expect, actual, summary + ': typeof (0 ? 0 : undef)');
64 actual = typeof (1 ? undef : 0);
71 reportCompare(expect, actual, summary + ': typeof (1 ? undef : 0)');
76 actual = typeof (!this ? 0 : undef);
83 reportCompare(expect, actual, summary + ': typeof (!this ? 0 : undef)');