S11.8.6_A6_T3.js (865B)
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 Only Function objects implement [[HasInstance]] and can be proper 7 ShiftExpression for the "instanceof" operator consequently 8 es5id: 11.8.6_A6_T3 9 description: Checking if RelationalExpression is function 10 ---*/ 11 12 function MyFunct(){return 0}; 13 14 //CHECK#1 15 if (MyFunct instanceof MyFunct){ 16 throw new Test262Error('#1 function MyFunct(){return 0}; MyFunct instanceof MyFunct === false'); 17 } 18 19 //CHECK#2 20 if (MyFunct instanceof Function !== true){ 21 throw new Test262Error('#2 function MyFunct(){return 0}; MyFunct instanceof Function === true'); 22 } 23 24 //CHECK#3 25 if (MyFunct instanceof Object !== true){ 26 throw new Test262Error('#3 function MyFunct(){return 0}; MyFunct instanceof Object === true'); 27 } 28 29 reportCompare(0, 0);