Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/instanceof/S11.8.6_A6_T3.js

raw
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 $ERROR('#1 function MyFunct(){return 0}; MyFunct instanceof MyFunct === false');
17 }
18
19 //CHECK#2
20 if (MyFunct instanceof Function !== true){
21 $ERROR('#2 function MyFunct(){return 0}; MyFunct instanceof Function === true');
22 }
23
24 //CHECK#3
25 if (MyFunct instanceof Object !== true){
26 $ERROR('#3 function MyFunct(){return 0}; MyFunct instanceof Object === true');
27 }