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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/. */
     7 /**
     8    File Name:          switch-001.js
     9    Section:
    10    Description:
    12    http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315767
    14    Verify that switches do not use strict equality in
    15    versions of JavaScript < 1.4
    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";
    25 startTest();
    26 writeHeaderToLog( SECTION + " "+ TITLE);
    28 result = "fail:  did not enter switch";
    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 }
    41 new TestCase(
    42   SECTION,
    43   "switch / case should use strict equality in version of JS < 1.4",
    44   "pass",
    45   result );
    49 test();

mercurial