S15.3.5.3_A3_T1.js (1062B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 Assume F is a Function object. When the [[HasInstance]] method of F is called with value V and V is an object, the following steps are taken: 7 i) Call the [[Get]] method of F with property name "prototype". 8 ii) Let O be Result(i) and O is an object. 9 iii) Let V be the value of the [[Prototype]] property of V. 10 iv) If V is null, return false. 11 v) If O and V refer to the same object or if they refer to objects joined to each other (13.1.2), return true. 12 vi) Go to step iii) 13 es5id: 15.3.5.3_A3_T1 14 description: F.prototype.type is 1, and V is new F 15 ---*/ 16 17 var FACTORY; 18 FACTORY = Function("this.name=\"root\""); 19 20 FACTORY.prototype.type=1; 21 22 var instance; 23 instance = new FACTORY; 24 25 //CHECK#1 26 if (!(instance instanceof FACTORY)) { 27 throw new Test262Error('#1: If O and V refer to the same object or if they refer to objects joined to each other (13.1.2), return true'); 28 } 29 30 reportCompare(0, 0);