js/src/tests/ecma/Expressions/11.12-4.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:          11.12-4.js
     9    ECMA Section:       11.12
    10    Description:
    12    The grammar for a ConditionalExpression in ECMAScript is a little bit
    13    different from that in C and Java, which each allow the second
    14    subexpression to be an Expression but restrict the third expression to
    15    be a ConditionalExpression.  The motivation for this difference in
    16    ECMAScript is to allow an assignment expression to be governed by either
    17    arm of a conditional and to eliminate the confusing and fairly useless
    18    case of a comma expression as the center expression.
    20    Author:             christine@netscape.com
    21    Date:               12 november 1997
    22 */
    24 var SECTION = "11.12-4";
    25 var VERSION = "ECMA_1";
    26 startTest();
    27 writeHeaderToLog( SECTION + " Conditional operator ( ? : )");
    29 // the following expression should NOT be an error in JS.
    31 new TestCase( SECTION,
    32 	      "true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1",
    33 	      "PASSED",
    34 	      eval("true ? MYVAR1 = 'PASSED' : MYVAR1 = 'FAILED'; MYVAR1") );
    36 test();

mercurial