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.
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-001";
18 var VERSION = "ECMA_2";
19 var TITLE = "instanceof"
21 startTest();
22 writeHeaderToLog( SECTION + " "+ TITLE);
24 function InstanceOf( object_1, object_2, expect ) {
25 result = object_1 instanceof object_2;
27 new TestCase(
28 SECTION,
29 "(" + object_1 + ") instanceof " + object_2,
30 expect,
31 result );
32 }
34 function Gen3(value) {
35 this.value = value;
36 this.generation = 3;
37 this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
38 }
39 Gen3.name = 3;
40 Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
42 function Gen2(value) {
43 this.value = value;
44 this.generation = 2;
45 }
46 Gen2.name = 2;
47 Gen2.prototype = new Gen3();
49 function Gen1(value) {
50 this.value = value;
51 this.generation = 1;
52 }
53 Gen1.name = 1;
54 Gen1.prototype = new Gen2();
56 function Gen0(value) {
57 this.value = value;
58 this.generation = 0;
59 }
60 Gen0.name = 0;
61 Gen0.prototype = new Gen1();
64 function GenA(value) {
65 this.value = value;
66 this.generation = "A";
67 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
69 }
70 GenA.prototype = new Gen0();
71 GenA.name = "A";
73 function GenB(value) {
74 this.value = value;
75 this.generation = "B";
76 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
77 }
78 GenB.name = "B"
79 GenB.prototype = void 0;
81 // RelationalExpression is not an object.
83 InstanceOf( true, Boolean, false );
84 InstanceOf( new Boolean(false), Boolean, true );
86 // __proto__ of RelationalExpression is null. should return false
87 genA = new GenA();
88 genA.__proto__ = null;
90 InstanceOf( genA, GenA, false );
92 // RelationalExpression.__proto__ == (but not ===) Identifier.prototype
94 InstanceOf( new Gen2(), Gen0, false );
95 InstanceOf( new Gen2(), Gen1, false );
96 InstanceOf( new Gen2(), Gen2, true );
97 InstanceOf( new Gen2(), Gen3, true );
99 // RelationalExpression.__proto__.__proto__ === Identifier.prototype
100 InstanceOf( new Gen0(), Gen0, true );
101 InstanceOf( new Gen0(), Gen1, true );
102 InstanceOf( new Gen0(), Gen2, true );
103 InstanceOf( new Gen0(), Gen3, true );
105 InstanceOf( new Gen0(), Object, true );
106 InstanceOf( new Gen0(), Function, false );
108 InstanceOf( Gen0, Function, true );
109 InstanceOf( Gen0, Object, true );
111 test();