|
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 * [[HasInstance]] returns a boolean value indicating whether Value delegates behaviour to this object |
|
6 * |
|
7 * @path ch08/8.6/8.6.2/S8.6.2_A4.js |
|
8 * @description Check that the obj instance of Object, but not instance |
|
9 * of Function, String, Number, Array |
|
10 */ |
|
11 |
|
12 var __obj={}; |
|
13 |
|
14 ////////////////////////////////////////////////////////////////////////////// |
|
15 //CHECK#1 |
|
16 if (!(__obj instanceof Object)) { |
|
17 $ERROR('#1: var __obj={}; (__obj instanceof Object) === true. Actual: ' + ((__obj instanceof Object))); |
|
18 } |
|
19 // |
|
20 ////////////////////////////////////////////////////////////////////////////// |
|
21 |
|
22 ////////////////////////////////////////////////////////////////////////////// |
|
23 //CHECK#2 |
|
24 if (__obj instanceof Function) { |
|
25 $ERROR('#2: var __obj={}; (__obj instanceof Function) === false. Actual: ' + ((__obj instanceof Function))); |
|
26 } |
|
27 // |
|
28 ////////////////////////////////////////////////////////////////////////////// |
|
29 |
|
30 ////////////////////////////////////////////////////////////////////////////// |
|
31 //CHECK#3 |
|
32 if (__obj instanceof String) { |
|
33 $ERROR('#3: var __obj={}; (__obj instanceof String) === false. Actual: ' + ((__obj instanceof String))); |
|
34 } |
|
35 // |
|
36 ////////////////////////////////////////////////////////////////////////////// |
|
37 |
|
38 ////////////////////////////////////////////////////////////////////////////// |
|
39 //CHECK#4 |
|
40 if (__obj instanceof Number) { |
|
41 $ERROR('#4: var __obj={}; (__obj instanceof Number) === false. Actual: ' + ((__obj instanceof Number))); |
|
42 } |
|
43 // |
|
44 ////////////////////////////////////////////////////////////////////////////// |
|
45 |
|
46 ////////////////////////////////////////////////////////////////////////////// |
|
47 //CHECK#5 |
|
48 if (__obj instanceof Array) { |
|
49 $ERROR('#5: var __obj={}; (__obj instanceof Array) === false. Actual: ' + ((__obj instanceof Array))); |
|
50 } |
|
51 // |
|
52 ////////////////////////////////////////////////////////////////////////////// |
|
53 |