blob: 90d9d1f6fb6c9df279de8c57288dcbb443f25242 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
Only Function objects implement [[HasInstance]] and can be proper
ShiftExpression for the "instanceof" operator consequently
es5id: 11.8.6_A6_T3
description: Checking if RelationalExpression is function
---*/
function MyFunct(){return 0};
//CHECK#1
if (MyFunct instanceof MyFunct){
$ERROR('#1 function MyFunct(){return 0}; MyFunct instanceof MyFunct === false');
}
//CHECK#2
if (MyFunct instanceof Function !== true){
$ERROR('#2 function MyFunct(){return 0}; MyFunct instanceof Function === true');
}
//CHECK#3
if (MyFunct instanceof Object !== true){
$ERROR('#3 function MyFunct(){return 0}; MyFunct instanceof Object === true');
}
|