1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 * File Name: instanceof-001.js
7 * RelationalExpression instanceof Identifier
9 * Author: christine@netscape.com
10 * Date: 2 September 1998
12 var SECTION = "instanceof-003-n";
13 var VERSION = "ECMA_2";
14 var TITLE = "instanceof"
17 writeHeaderToLog( SECTION + " "+ TITLE);
19 function InstanceOf( object_1, object_2, expect ) {
21 result = object_1 instanceof object_2;
25 "(" + object_1 + ") instanceof " + object_2,
30 function Gen3(value) {
33 this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" );
36 Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\"");
38 function Gen2(value) {
43 Gen2.prototype = new Gen3();
45 function Gen1(value) {
50 Gen1.prototype = new Gen2();
52 function Gen0(value) {
57 Gen0.prototype = new Gen1();
60 function GenA(value) {
62 this.generation = "A";
63 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
66 GenA.prototype = new Gen0();
69 function GenB(value) {
71 this.generation = "B";
72 this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" );
75 GenB.prototype = void 0;
77 // Identifier is not a function
78 DESCRIPTION = "Identifier is not a function";
81 InstanceOf( true, true, "error" );