js/src/tests/ecma_2/Statements/label-002.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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:          label-002.js
     9  *  ECMA Section:
    10  *  Description:        Labeled statements
    11  *
    12  *  Labeled break and continue within a for-in loop.
    13  *
    14  *
    15  *  Author:             christine@netscape.com
    16  *  Date:               11 August 1998
    17  */
    18 var SECTION = "label-002";
    19 var VERSION = "ECMA_2";
    20 var TITLE   = "Labeled statements";
    22 startTest();
    23 writeHeaderToLog( SECTION + " "+ TITLE);
    25 LabelTest( { p1:"hi,", p2:" norris" }, "hi, norris", " norrishi," );
    26 LabelTest( { 0:"zero", 1:"one" }, "zeroone", "onezero" );
    28 LabelTest2( { p1:"hi,", p2:" norris" }, "hi,", " norris" );
    29 LabelTest2( { 0:"zero", 1:"one" }, "zero", "one" );
    31 test();
    33 function LabelTest( object, expect1, expect2 ) {
    34   result = "";
    36 yoohoo:  { for ( property in object ) { result += object[property]; }; break yoohoo };
    38   new TestCase(
    39     SECTION,
    40     "yoohoo: for ( property in object ) { result += object[property]; } break yoohoo }",
    41     true,
    42     result == expect1 || result == expect2 );
    43 }
    45 function LabelTest2( object, expect1, expect2 ) {
    46   result = "";
    48 yoohoo:  { for ( property in object ) { result += object[property]; break yoohoo } }; ;
    50   new TestCase(
    51     SECTION,
    52     "yoohoo: for ( property in object ) { result += object[property]; break yoohoo }}",
    53     true,
    54     result == expect1 || result == expect2 );
    55 }

mercurial