summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/instanceof/S15.3.5.3_A2_T2.js
blob: e232b1ab2d04ec14f87e557aec5d41d78572b1ef (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
28
29
30
31
32
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: |
    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:
    i) Call the [[Get]] method of F with property name "prototype".
    ii) Let O be Result(i).
    iii) O is not an object, throw a TypeError exception
es5id: 15.3.5.3_A2_T2
description: F.prototype is undefined, and V is empty object
---*/

var FACTORY;
FACTORY = new Function;

FACTORY.prototype = undefined;

var obj;
obj={};

//CHECK#1
try {
  obj instanceof  FACTORY;
  $ERROR('#1: O is not an object, throw a TypeError exception');
} catch (e) {
  if (!(e instanceof TypeError)) {
  	$ERROR('#1.1: O is not an object, throw a TypeError exception');
  }
}

reportCompare(0, 0);