Debian Codegraph @

rhino/testsrc/tests/ecma_2/extensions/instanceof-003-n.js

raw symbols SCIP
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/. */
5
6 gTestfile = 'instanceof-003-n.js';
7
8 /**
9 * File Name: instanceof-001.js
10 * ECMA Section: 11.8.6
11 * Description:
12 *
13 * RelationalExpression instanceof Identifier
14 *
15 * Author: [email protected]
16 * Date: 2 September 1998
17 */
18 var SECTION = "instanceof-003-n";
19 var VERSION = "ECMA_2";
20 var TITLE = "instanceof"
21
22 startTest();
23 writeHeaderToLog( SECTION + " "+ TITLE);
24
25 function InstanceOf( object_1, object_2, expect ) {
26
27 result = object_1 instanceof object_2;
28
29 new TestCase(
30 SECTION,
31 "(" + object_1 + ") instanceof " + object_2,
32 expect,
33 result );
34 }
35
36 function Gen3(value) {
37 this.value = value;
38 this.generation = 3;
39 this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
40 }
41 Gen3.name = 3;
42 Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
43
44 function Gen2(value) {
45 this.value = value;
46 this.generation = 2;
47 }
48 Gen2.name = 2;
49 Gen2.prototype = new Gen3();
50
51 function Gen1(value) {
52 this.value = value;
53 this.generation = 1;
54 }
55 Gen1.name = 1;
56 Gen1.prototype = new Gen2();
57
58 function Gen0(value) {
59 this.value = value;
60 this.generation = 0;
61 }
62 Gen0.name = 0;
63 Gen0.prototype = new Gen1();
64
65
66 function GenA(value) {
67 this.value = value;
68 this.generation = "A";
69 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
70
71 }
72 GenA.prototype = new Gen0();
73 GenA.name = "A";
74
75 function GenB(value) {
76 this.value = value;
77 this.generation = "B";
78 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
79 }
80 GenB.name = "B"
81 GenB.prototype = void 0;
82
83 // Identifier is not a function
84 DESCRIPTION = "Identifier is not a function";
85 EXPECTED = "error";
86
87 InstanceOf( true, true, "error" );
88
89 test();