js/src/tests/ecma_2/extensions/instanceof-003-n.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:          instanceof-001.js
     9  *  ECMA Section:       11.8.6
    10  *  Description:
    11  *
    12  *  RelationalExpression instanceof Identifier
    13  *
    14  *  Author:             christine@netscape.com
    15  *  Date:               2 September 1998
    16  */
    17 var SECTION = "instanceof-003-n";
    18 var VERSION = "ECMA_2";
    19 var TITLE   = "instanceof"
    21   startTest();
    22 writeHeaderToLog( SECTION + " "+ TITLE);
    24 function InstanceOf( object_1, object_2, expect ) {
    26   result = object_1 instanceof object_2;
    28   new TestCase(
    29     SECTION,
    30     "(" + object_1 + ") instanceof " + object_2,
    31     expect,
    32     result );
    33 }
    35 function Gen3(value) {
    36   this.value = value;
    37   this.generation = 3;
    38   this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
    39 }
    40 Gen3.name = 3;
    41 Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
    43 function Gen2(value) {
    44   this.value = value;
    45   this.generation = 2;
    46 }
    47 Gen2.name = 2;
    48 Gen2.prototype = new Gen3();
    50 function Gen1(value) {
    51   this.value = value;
    52   this.generation = 1;
    53 }
    54 Gen1.name = 1;
    55 Gen1.prototype = new Gen2();
    57 function Gen0(value) {
    58   this.value = value;
    59   this.generation = 0;
    60 }
    61 Gen0.name = 0;
    62 Gen0.prototype = new Gen1();
    65 function GenA(value) {
    66   this.value = value;
    67   this.generation = "A";
    68   this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
    70 }
    71 GenA.prototype = new Gen0();
    72 GenA.name = "A";
    74 function GenB(value) {
    75   this.value = value;
    76   this.generation = "B";
    77   this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
    78 }
    79 GenB.name = "B"
    80   GenB.prototype = void 0;
    82 // Identifier is not a function
    83 DESCRIPTION = "Identifier is not a function";
    84 EXPECTED = "error";
    86 InstanceOf( true, true, "error" );
    88 test();

mercurial