js/src/tests/ecma_2/Statements/dowhile-005.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:          dowhile-005
     9  *  ECMA Section:
    10  *  Description:        do...while statements
    11  *
    12  *  Test a labeled do...while.  Break out of the loop with no label
    13  *  should break out of the loop, but not out of the label.
    14  *
    15  *  Currently causes an infinite loop in the monkey.  Uncomment the
    16  *  print statement below and it works OK.
    17  *
    18  *  Author:             christine@netscape.com
    19  *  Date:               26 August 1998
    20  */
    21 var SECTION = "dowhile-005";
    22 var VERSION = "ECMA_2";
    23 var TITLE   = "do...while with a labeled continue statement";
    24 var BUGNUMBER = "316293";
    26 startTest();
    27 writeHeaderToLog( SECTION + " "+ TITLE);
    29 NestedLabel();
    32 test();
    34 function NestedLabel() {
    35   i = 0;
    36   result1 = "pass";
    37   result2 = "fail: did not hit code after inner loop";
    38   result3 = "pass";
    40 outer: {
    41     do {
    42     inner: {
    43 //                    print( i );
    44 	break inner;
    45 	result1 = "fail: did break out of inner label";
    46       }
    47       result2 = "pass";
    48       break outer;
    49       print(i);
    50     } while ( i++ < 100 );
    52   }
    54   result3 = "fail: did not break out of outer label";
    56   new TestCase(
    57     SECTION,
    58     "number of loop iterations",
    59     0,
    60     i );
    62   new TestCase(
    63     SECTION,
    64     "break out of inner loop",
    65     "pass",
    66     result1 );
    68   new TestCase(
    69     SECTION,
    70     "break out of outer loop",
    71     "pass",
    72     result2 );
    73 }

mercurial