js/src/tests/js1_4/Regress/function-001.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:          function-001.js
     9  *  Description:
    10  *
    11  * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=325843
    12  * js> function f(a){var a,b;}
    13  *
    14  * causes an an assert on a null 'sprop' in the 'Variables' function in
    15  * jsparse.c This will crash non-debug build.
    16  *
    17  *  Author:             christine@netscape.com
    18  *  Date:               11 August 1998
    19  */
    20 var SECTION = "function-001.js";
    21 var VERSION = "JS1_4";
    22 var TITLE   = "Regression test case for 325843";
    23 var BUGNUMBER="3258435";
    24 startTest();
    26 writeHeaderToLog( SECTION + " "+ TITLE);
    28 eval("function f1 (a){ var a,b; }");
    30 function f2( a ) { var a, b; };
    32 new TestCase(
    33   SECTION,
    34   "eval(\"function f1 (a){ var a,b; }\"); "+
    35   "function f2( a ) { var a, b; }; typeof f1",
    36   "function",
    37   typeof f1 );
    39 // force a function decompilation
    41 new TestCase(
    42   SECTION,
    43   "typeof f1.toString()",
    44   "string",
    45   typeof f1.toString() );
    47 new TestCase(
    48   SECTION,
    49   "typeof f2",
    50   "function",
    51   typeof f2 );
    53 // force a function decompilation
    55 new TestCase(
    56   SECTION,
    57   "typeof f2.toString()",
    58   "string",
    59   typeof f2.toString() );
    61 test();

mercurial