js/src/tests/ecma_2/instanceof/instanceof-003.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-003.js
     9    ECMA Section:
    10    Description:        http://bugzilla.mozilla.org/show_bug.cgi?id=7635
    12    js> function Foo() {}
    13    js> theproto = {};
    14    [object Object]
    15    js> Foo.prototype = theproto
    16    [object Object]
    17    js> theproto instanceof Foo
    18    true
    20    I think this should be 'false'
    23    Author:             christine@netscape.com
    24    Date:               12 november 1997
    26    Modified to conform to ECMA3
    27    https://bugzilla.mozilla.org/show_bug.cgi?id=281606
    28 */
    29 var SECTION = "instanceof-003";
    30 var VERSION = "ECMA_2";
    31 var TITLE   = "instanceof operator";
    32 var BUGNUMBER ="7635";
    34 startTest();
    36 function Foo() {};
    37 theproto = {};
    38 Foo.prototype = theproto;
    40 AddTestCase(
    41   "function Foo() = {}; theproto = {}; Foo.prototype = theproto; " +
    42   "theproto instanceof Foo",
    43   false,
    44   theproto instanceof Foo );
    47 var o = {};
    49 // https://bugzilla.mozilla.org/show_bug.cgi?id=281606
    50 try
    51 {
    52   AddTestCase(
    53     "o = {}; o instanceof o",
    54     "error",
    55     o instanceof o );
    56 }
    57 catch(e)
    58 {
    59   AddTestCase(
    60     "o = {}; o instanceof o",
    61     "error",
    62     "error" );
    63 }
    65 test();

mercurial