js/src/tests/js1_5/Regress/regress-204210.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:    29 April 2003
     9  * SUMMARY: eval() is not a constructor, but don't crash on |new eval();|
    10  *
    11  * See http://bugzilla.mozilla.org/show_bug.cgi?id=204210
    12  *
    13  */
    14 //-----------------------------------------------------------------------------
    15 var UBound = 0;
    16 var BUGNUMBER = 204210;
    17 var summary = "eval() is not a constructor, but don't crash on |new eval();|";
    18 var status = '';
    19 var statusitems = [];
    20 var actual = '';
    21 var actualvalues = [];
    22 var expect= '';
    23 var expectedvalues = [];
    25 printBugNumber(BUGNUMBER);
    26 printStatus(summary);
    28 /*
    29  * Just testing that we don't crash on any of these constructs -
    30  */
    33 /*
    34  * global scope -
    35  */
    36 try
    37 {
    38   var x = new eval();
    39   new eval();
    40 }
    41 catch(e)
    42 {
    43 }
    46 /*
    47  * function scope -
    48  */
    49 f();
    50 function f()
    51 {
    52   try
    53   {
    54     var x = new eval();
    55     new eval();
    56   }
    57   catch(e)
    58   {
    59   }
    60 }
    63 /*
    64  * eval scope -
    65  */
    66 var s = '';
    67 s += 'try';
    68 s += '{';
    69 s += '  var x = new eval();';
    70 s += '  new eval();';
    71 s += '}';
    72 s += 'catch(e)';
    73 s += '{';
    74 s += '}';
    75 eval(s);
    78 /*
    79  * some combinations of scope -
    80  */
    81 s = '';
    82 s += 'function g()';
    83 s += '{';
    84 s += '  try';
    85 s += '  {';
    86 s += '    var x = new eval();';
    87 s += '    new eval();';
    88 s += '  }';
    89 s += '  catch(e)';
    90 s += '  {';
    91 s += '  }';
    92 s += '}';
    93 s += 'g();';
    94 eval(s);
    97 function h()
    98 {
    99   var s = '';
   100   s += 'function f()';
   101   s += '{';
   102   s += '  try';
   103   s += '  {';
   104   s += '    var x = new eval();';
   105   s += '    new eval();';
   106   s += '  }';
   107   s += '  catch(e)';
   108   s += '  {';
   109   s += '  }';
   110   s += '}';
   111   s += 'f();';
   112   eval(s);
   113 }
   114 h();
   116 reportCompare('No Crash', 'No Crash', '');

mercurial