js/src/tests/js1_3/Script/switch-001.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:4fbf1461475c
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
7 /**
8 File Name: switch-001.js
9 Section:
10 Description:
11
12 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315767
13
14 Verify that switches do not use strict equality in
15 versions of JavaScript < 1.4
16
17 Author: christine@netscape.com
18 Date: 12 november 1997
19 */
20 var SECTION = "switch-001";
21 var VERSION = "JS1_3";
22 var TITLE = "switch-001";
23 var BUGNUMBER="315767";
24
25 startTest();
26 writeHeaderToLog( SECTION + " "+ TITLE);
27
28 result = "fail: did not enter switch";
29
30 switch (true) {
31 case 1:
32 result = "fail: for backwards compatibility, version 130 use strict equality";
33 break;
34 case true:
35 result = "pass";
36 break;
37 default:
38 result = "fail: evaluated default statement";
39 }
40
41 new TestCase(
42 SECTION,
43 "switch / case should use strict equality in version of JS < 1.4",
44 "pass",
45 result );
46
47
48
49 test();
50

mercurial