| * File Name: instanceof-001.js |
| * RelationalExpression instanceof Identifier |
| * Author: christine@netscape.com |
| var SECTION = "instanceof-001"; |
| writeHeaderToLog( SECTION + " "+ TITLE); |
| var testcases = new Array(); |
| function InstanceOf( object_1, object_2, expect ) { |
| result = object_1 instanceof object_2; |
| testcases[tc++] = new TestCase( |
| "(" + object_1 + ") instanceof " + object_2, |
| this.toString = new Function ( "return \"(Gen\"+this.generation+\" instance)\"" ); |
| Gen3.__proto__.toString = new Function( "return \"(\"+this.name+\" object)\""); |
| Gen2.prototype = new Gen3(); |
| Gen1.prototype = new Gen2(); |
| Gen0.prototype = new Gen1(); |
| this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); |
| GenA.prototype = new Gen0(); |
| this.toString = new Function ( "return \"(instance of Gen\"+this.generation+\")\"" ); |
| // Identifier is a function, prototype of Identifier is not an object |
| InstanceOf( new GenB(), GenB, false ); |