Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | |
michael@0 | 7 | /** |
michael@0 | 8 | * File Name: instanceof-001.js |
michael@0 | 9 | * ECMA Section: 11.8.6 |
michael@0 | 10 | * Description: |
michael@0 | 11 | * |
michael@0 | 12 | * RelationalExpression instanceof Identifier |
michael@0 | 13 | * |
michael@0 | 14 | * Author: christine@netscape.com |
michael@0 | 15 | * Date: 2 September 1998 |
michael@0 | 16 | */ |
michael@0 | 17 | var SECTION = "instanceof-004-n"; |
michael@0 | 18 | var VERSION = "ECMA_2"; |
michael@0 | 19 | var TITLE = "instanceof" |
michael@0 | 20 | |
michael@0 | 21 | startTest(); |
michael@0 | 22 | writeHeaderToLog( SECTION + " "+ TITLE); |
michael@0 | 23 | |
michael@0 | 24 | function InstanceOf( object_1, object_2, expect ) { |
michael@0 | 25 | result = object_1 instanceof object_2; |
michael@0 | 26 | |
michael@0 | 27 | new TestCase( |
michael@0 | 28 | SECTION, |
michael@0 | 29 | "(" + object_1 + ") instanceof " + object_2, |
michael@0 | 30 | expect, |
michael@0 | 31 | result ); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function Gen3(value) { |
michael@0 | 35 | this.value = value; |
michael@0 | 36 | this.generation = 3; |
michael@0 | 37 | this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); |
michael@0 | 38 | } |
michael@0 | 39 | Gen3.name = 3; |
michael@0 | 40 | Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); |
michael@0 | 41 | |
michael@0 | 42 | function Gen2(value) { |
michael@0 | 43 | this.value = value; |
michael@0 | 44 | this.generation = 2; |
michael@0 | 45 | } |
michael@0 | 46 | Gen2.name = 2; |
michael@0 | 47 | Gen2.prototype = new Gen3(); |
michael@0 | 48 | |
michael@0 | 49 | function Gen1(value) { |
michael@0 | 50 | this.value = value; |
michael@0 | 51 | this.generation = 1; |
michael@0 | 52 | } |
michael@0 | 53 | Gen1.name = 1; |
michael@0 | 54 | Gen1.prototype = new Gen2(); |
michael@0 | 55 | |
michael@0 | 56 | function Gen0(value) { |
michael@0 | 57 | this.value = value; |
michael@0 | 58 | this.generation = 0; |
michael@0 | 59 | } |
michael@0 | 60 | Gen0.name = 0; |
michael@0 | 61 | Gen0.prototype = new Gen1(); |
michael@0 | 62 | |
michael@0 | 63 | |
michael@0 | 64 | function GenA(value) { |
michael@0 | 65 | this.value = value; |
michael@0 | 66 | this.generation = "A"; |
michael@0 | 67 | this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); |
michael@0 | 68 | |
michael@0 | 69 | } |
michael@0 | 70 | GenA.prototype = new Gen0(); |
michael@0 | 71 | GenA.name = "A"; |
michael@0 | 72 | |
michael@0 | 73 | function GenB(value) { |
michael@0 | 74 | this.value = value; |
michael@0 | 75 | this.generation = "B"; |
michael@0 | 76 | this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); |
michael@0 | 77 | } |
michael@0 | 78 | GenB.name = "B" |
michael@0 | 79 | GenB.prototype = void 0; |
michael@0 | 80 | |
michael@0 | 81 | // Identifier is not a function |
michael@0 | 82 | |
michael@0 | 83 | DESCRIPTION = "Identifier is not a function"; |
michael@0 | 84 | EXPECTED = "error"; |
michael@0 | 85 | |
michael@0 | 86 | InstanceOf( new Boolean(true), false, "error" ); |
michael@0 | 87 | |
michael@0 | 88 | test(); |