]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/instanceof/instanceof-003.js
1b0a01b5987f14189abefafb2db2bda233ffba91
[apple/javascriptcore.git] / tests / mozilla / ecma_2 / instanceof / instanceof-003.js
1 /**
2 File Name: instanceof-003.js
3 ECMA Section:
4 Description: http://bugzilla.mozilla.org/show_bug.cgi?id=7635
5
6 js> function Foo() {}
7 js> theproto = {};
8 [object Object]
9 js> Foo.prototype = theproto
10 [object Object]
11 js> theproto instanceof Foo
12 true
13
14 I think this should be 'false'
15
16
17 Author: christine@netscape.com
18 Date: 12 november 1997
19 */
20 var SECTION = "instanceof-003";
21 var VERSION = "ECMA_2";
22 var TITLE = "instanceof operator";
23 var BUGNUMBER ="http://bugzilla.mozilla.org/show_bug.cgi?id=7635";
24
25 startTest();
26
27 function Foo() {};
28 theproto = {};
29 Foo.prototype = theproto;
30
31 AddTestCase(
32 "function Foo() = {}; theproto = {}; Foo.prototype = theproto; " +
33 "theproto instanceof Foo",
34 false,
35 theproto instanceof Foo );
36
37
38 var o = {};
39
40 AddTestCase(
41 "o = {}; o instanceof o",
42 false,
43 o instanceof o );
44
45
46 test();