js/src/tests/js1_5/Regress/regress-321757.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/. */
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 321757;
     8 var summary = 'Compound assignment operators should not bind LHS';
     9 var actual = '';
    10 var expect = 'pass';
    12 printBugNumber(BUGNUMBER);
    13 printStatus (summary);
    15 try
    16 {
    17   foo += 1;
    18   actual = "fail";
    19 }
    20 catch (e)
    21 {
    22   actual = "pass";
    23 }
    25 reportCompare(expect, actual, summary + ': +=');
    27 try
    28 {
    29   foo -= 1;
    30   actual = "fail";
    31 }
    32 catch (e)
    33 {
    34   actual = "pass";
    35 }
    37 reportCompare(expect, actual, summary + ': -=');
    39 try
    40 {
    41   foo *= 1;
    42   actual = "fail";
    43 }
    44 catch (e)
    45 {
    46   actual = "pass";
    47 }
    49 reportCompare(expect, actual, summary + ': *=');
    51 try
    52 {
    53   foo /= 1;
    54   actual = "fail";
    55 }
    56 catch (e)
    57 {
    58   actual = "pass";
    59 }
    61 reportCompare(expect, actual, summary + ': /=');
    63 try
    64 {
    65   foo %= 1;
    66   actual = "fail";
    67 }
    68 catch (e)
    69 {
    70   actual = "pass";
    71 }
    73 reportCompare(expect, actual, summary + ': %=');
    75 try
    76 {
    77   foo <<= 1;
    78   actual = "fail";
    79 }
    80 catch (e)
    81 {
    82   actual = "pass";
    83 }
    85 reportCompare(expect, actual, summary + ': <<=');
    87 try
    88 {
    89   foo >>= 1;
    90   actual = "fail";
    91 }
    92 catch (e)
    93 {
    94   actual = "pass";
    95 }
    97 reportCompare(expect, actual, summary + ': >>=');
    99 try
   100 {
   101   foo >>>= 1;
   102   actual = "fail";
   103 }
   104 catch (e)
   105 {
   106   actual = "pass";
   107 }
   109 reportCompare(expect, actual, summary + ': >>>=');

mercurial