Debian Codegraph @

rhino/testsrc/tests/js1_3/Script/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
17
18 Author: [email protected]
19 Date: 12 november 1997
20 */
21 var SECTION = "switch-001";
22 var VERSION = "JS1_3";
23 var TITLE = "switch-001";
24 var BUGNUMBER="315767";
25
26 startTest();
27 writeHeaderToLog( SECTION + " "+ TITLE);
28
29 result = "fail: did not enter switch";
30
31 switch (true) {
32 case 1:
33 result = "fail: for backwards compatibility, version 130 use strict equality";
34 break;
35 case true:
36 result = "pass";
37 break;
38 default:
39 result = "fail: evaluated default statement";
40 }
41
42 new TestCase(
43 SECTION,
44 "switch / case should use strict equality in version of JS < 1.4",
45 "pass",
46 result );
47
48
49
50 test();
51