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.

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-003-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
michael@0 26 result = object_1 instanceof object_2;
michael@0 27
michael@0 28 new TestCase(
michael@0 29 SECTION,
michael@0 30 "(" + object_1 + ") instanceof " + object_2,
michael@0 31 expect,
michael@0 32 result );
michael@0 33 }
michael@0 34
michael@0 35 function Gen3(value) {
michael@0 36 this.value = value;
michael@0 37 this.generation = 3;
michael@0 38 this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
michael@0 39 }
michael@0 40 Gen3.name = 3;
michael@0 41 Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
michael@0 42
michael@0 43 function Gen2(value) {
michael@0 44 this.value = value;
michael@0 45 this.generation = 2;
michael@0 46 }
michael@0 47 Gen2.name = 2;
michael@0 48 Gen2.prototype = new Gen3();
michael@0 49
michael@0 50 function Gen1(value) {
michael@0 51 this.value = value;
michael@0 52 this.generation = 1;
michael@0 53 }
michael@0 54 Gen1.name = 1;
michael@0 55 Gen1.prototype = new Gen2();
michael@0 56
michael@0 57 function Gen0(value) {
michael@0 58 this.value = value;
michael@0 59 this.generation = 0;
michael@0 60 }
michael@0 61 Gen0.name = 0;
michael@0 62 Gen0.prototype = new Gen1();
michael@0 63
michael@0 64
michael@0 65 function GenA(value) {
michael@0 66 this.value = value;
michael@0 67 this.generation = "A";
michael@0 68 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
michael@0 69
michael@0 70 }
michael@0 71 GenA.prototype = new Gen0();
michael@0 72 GenA.name = "A";
michael@0 73
michael@0 74 function GenB(value) {
michael@0 75 this.value = value;
michael@0 76 this.generation = "B";
michael@0 77 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
michael@0 78 }
michael@0 79 GenB.name = "B"
michael@0 80 GenB.prototype = void 0;
michael@0 81
michael@0 82 // Identifier is not a function
michael@0 83 DESCRIPTION = "Identifier is not a function";
michael@0 84 EXPECTED = "error";
michael@0 85
michael@0 86 InstanceOf( true, true, "error" );
michael@0 87
michael@0 88 test();

mercurial