js/src/tests/js1_5/Regress/regress-110286.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  *
     8  * Date: 16 Nov 2001
     9  * SUMMARY: multiline comments containing "/*" should not be syntax errors
    10  * See http://bugzilla.mozilla.org/show_bug.cgi?id=110286
    11  *
    12  */
    13 //-----------------------------------------------------------------------------
    14 var UBound = 0;
    15 var BUGNUMBER = 110286;
    16 var summary = 'Multiline comments containing "/*" should not be syntax errors';
    17 var status = '';
    18 var statusitems = [];
    19 var actual = '';
    20 var actualvalues = [];
    21 var expect= '';
    22 var expectedvalues = [];
    25 status = inSection(1);
    26 actual = eval("/* /* */3");
    27 expect = 3;
    28 addThis();
    30 status = inSection(2);
    31 actual = eval("3/* /* */");
    32 expect = 3;
    33 addThis();
    35 status = inSection(3);
    36 actual = eval("/* 3/* */");
    37 expect = undefined;
    38 addThis();
    40 status = inSection(4);
    41 actual = eval("/* /*3 */");
    42 expect = undefined;
    43 addThis();
    45 status = inSection(5);
    46 var passed = true;
    47 try
    48 {
    49   eval("/* blah blah /* blah blah */");
    50 }
    51 catch(e)
    52 {
    53   passed = false;
    54 }
    55 actual = passed;
    56 expect = true;
    57 addThis();
    60 status = inSection(6);
    61 try
    62 {
    63   /*
    64     /*A/* /* /*A/*
    65     /* blah blah /*
    66     /* blah blah /*
    67     /* /*A/* /*A/*
    68   */
    69   var result = 'PASSED';
    70 }
    71 catch(e)
    72 {
    73   var result = 'FAILED';
    74 }
    75 actual = result;
    76 expect = 'PASSED';
    77 addThis();
    80 status = inSection(7);
    81 var str = 'ABC';
    82 /*
    83  *    /*
    84  *    /*
    85  *    /*
    86  *    /*
    87  *
    88  */
    89 str += 'DEF';
    90 actual = str;
    91 expect = 'ABCDEF';
    92 addThis();
    96 //-----------------------------------------------------------------------------
    97 test();
    98 //-----------------------------------------------------------------------------
   101 function addThis()
   102 {
   103   statusitems[UBound] = status;
   104   actualvalues[UBound] = actual;
   105   expectedvalues[UBound] = expect;
   106   UBound++;
   107 }
   110 function test()
   111 {
   112   enterFunc ('test');
   113   printBugNumber(BUGNUMBER);
   114   printStatus (summary);
   116   for (var i = 0; i < UBound; i++)
   117   {
   118     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
   119   }
   121   exitFunc ('test');
   122 }

mercurial