js/src/tests/js1_5/Exceptions/regress-347674.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     = "347674";
     8 var summary = "ReferenceError thrown when accessing exception bound in a " +
     9   "catch block in a try block within that catch block";
    10 var actual, expect;
    12 printBugNumber(BUGNUMBER);
    13 printStatus(summary);
    15 /**************
    16  * BEGIN TEST *
    17  **************/
    19 var failed = false;
    21 function foo()
    22 {
    23   try
    24   {
    25     throw "32.9";
    26   }
    27   catch (e)
    28   {
    29     try
    30     {
    31       var errorCode = /^(\d+)\s+.*$/.exec(e)[1];
    32     }
    33     catch (e2)
    34     {
    35       void("*** internal error: e == " + e + ", e2 == " + e2);
    36       throw e2;
    37     }
    38   }
    39 }
    41 try
    42 {
    43   try
    44   {
    45     foo();
    46   }
    47   catch (ex)
    48   {
    49     if (!(ex instanceof TypeError))
    50       throw "Wrong value thrown!\n" +
    51 	"  expected: a TypeError ('32.9' doesn't match the regexp)\n" +
    52 	"  actual: " + ex;
    53   }
    54 }
    55 catch (e)
    56 {
    57   failed = e;
    58 }
    60 expect = false;
    61 actual = failed;
    63 reportCompare(expect, actual, summary);

mercurial