Debian Codegraph @

rhino/testsrc/tests/js1_3/regress/switch-001.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 gTestfile = 'switch-001.js';
7
8 /**
9 File Name: switch-001.js
10 Section:
11 Description:
12
13 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315767
14
15 Verify that switches do not use strict equality in
16 versions of JavaScript < 1.4. It's now been decided that
17 we won't put in version switches, so all switches will
18 be ECMA.
19
20 Author: [email protected]
21 Date: 12 november 1997
22 */
23 var SECTION = "switch-001";
24 var VERSION = "JS1_3";
25 var TITLE = "switch-001";
26 var BUGNUMBER="315767";
27
28 startTest();
29 writeHeaderToLog( SECTION + " "+ TITLE);
30
31 result = "fail: did not enter switch";
32
33 switch (true) {
34 case 1:
35 result = "fail: version 130 should force strict equality";
36 break;
37 case true:
38 result = "pass";
39 break;
40 default:
41 result = "fail: evaluated default statement";
42 }
43
44 new TestCase(
45 SECTION,
46 "switch / case should use strict equality in version of JS < 1.4",
47 "pass",
48 result );
49
50 test();
51