|
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 * Result of applying "typeof" operator to the object that is native and doesn't implement [[Call]] is "object" |
|
6 * |
|
7 * @path ch11/11.4/11.4.3/S11.4.3_A3.6.js |
|
8 * @description typeof (object without [[Call]]) === "object" |
|
9 */ |
|
10 |
|
11 //CHECK#1 |
|
12 if (typeof this !== "object") { |
|
13 $ERROR('#1: typeof this === "object". Actual: ' + (typeof this)); |
|
14 } |
|
15 |
|
16 //CHECK#2 |
|
17 if (typeof new Object() !== "object") { |
|
18 $ERROR('#2: typeof new Object() === "object". Actual: ' + (typeof new Object())); |
|
19 } |
|
20 |
|
21 //CHECK#3 |
|
22 if (typeof new Array(1,2,3) !== "object") { |
|
23 $ERROR('#3: typeof new Array(1,2,3) === "object". Actual: ' + (typeof new Array(1,2,3))); |
|
24 } |
|
25 |
|
26 //CHECK#4 |
|
27 if (typeof Array(1,2,3) !== "object") { |
|
28 $ERROR('#4: typeof Array(1,2,3) === "object". Actual: ' + (typeof Array(1,2,3))); |
|
29 } |
|
30 |
|
31 //CHECK#5 |
|
32 if (typeof new String("x") !== "object") { |
|
33 $ERROR('#5: typeof new String("x") === "object". Actual: ' + (typeof new String("x"))); |
|
34 } |
|
35 |
|
36 //CHECK#6 |
|
37 if (typeof new Boolean(true) !== "object") { |
|
38 $ERROR('#6: typeof new Boolean(true) === "object". Actual: ' + (typeof new Boolean(true))); |
|
39 } |
|
40 |
|
41 //CHECK#7 |
|
42 if (typeof new Number(1) !== "object") { |
|
43 $ERROR('#7: typeof new Number(1) === "object". Actual: ' + (typeof new Number(1))); |
|
44 } |
|
45 |
|
46 //CHECK#8 |
|
47 //The Math object does not have a [[Construct]] property; |
|
48 //it is not possible to use the Math object as a constructor with the new operator. |
|
49 //The Math object does not have a [[Call]] property; it is not possible to invoke the Math object as a object. |
|
50 if (typeof Math !== "object") { |
|
51 $ERROR('#8: typeof Math === "object". Actual: ' + (typeof Math)); |
|
52 } |
|
53 |
|
54 //CHECK#9 |
|
55 if (typeof new Date() !== "object") { |
|
56 $ERROR('#9: typeof new Date() === "object". Actual: ' + (typeof new Date())); |
|
57 } |
|
58 |
|
59 //CHECK#10 |
|
60 if (typeof new Error() !== "object") { |
|
61 $ERROR('#10: typeof new Error() === "object". Actual: ' + (typeof new Error())); |
|
62 } |
|
63 |
|
64 //CHECK#11 |
|
65 if (typeof new RegExp() !== "object") { |
|
66 $ERROR('#11: typeof new RegExp() === "object". Actual: ' + (typeof new RegExp())); |
|
67 } |
|
68 |
|
69 //CHECK#12 |
|
70 if (typeof RegExp() !== "object") { |
|
71 $ERROR('#12: typeof RegExp() === "object". Actual: ' + (typeof RegExp())); |
|
72 } |
|
73 |