| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = '11.4.3.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
var SECTION = "11.4.3"; |
| 27 |
|
| 28 |
var VERSION = "ECMA_1"; |
| 29 |
startTest(); |
| 30 |
var TITLE = " The typeof operator"; |
| 31 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 32 |
|
| 33 |
new TestCase( SECTION, "typeof(void(0))", "undefined", typeof(void(0)) ); |
| 34 |
new TestCase( SECTION, "typeof(null)", "object", typeof(null) ); |
| 35 |
new TestCase( SECTION, "typeof(true)", "boolean", typeof(true) ); |
| 36 |
new TestCase( SECTION, "typeof(false)", "boolean", typeof(false) ); |
| 37 |
new TestCase( SECTION, "typeof(new Boolean())", "object", typeof(new Boolean()) ); |
| 38 |
new TestCase( SECTION, "typeof(new Boolean(true))", "object", typeof(new Boolean(true)) ); |
| 39 |
new TestCase( SECTION, "typeof(Boolean())", "boolean", typeof(Boolean()) ); |
| 40 |
new TestCase( SECTION, "typeof(Boolean(false))", "boolean", typeof(Boolean(false)) ); |
| 41 |
new TestCase( SECTION, "typeof(Boolean(true))", "boolean", typeof(Boolean(true)) ); |
| 42 |
new TestCase( SECTION, "typeof(NaN)", "number", typeof(Number.NaN) ); |
| 43 |
new TestCase( SECTION, "typeof(Infinity)", "number", typeof(Number.POSITIVE_INFINITY) ); |
| 44 |
new TestCase( SECTION, "typeof(-Infinity)", "number", typeof(Number.NEGATIVE_INFINITY) ); |
| 45 |
new TestCase( SECTION, "typeof(Math.PI)", "number", typeof(Math.PI) ); |
| 46 |
new TestCase( SECTION, "typeof(0)", "number", typeof(0) ); |
| 47 |
new TestCase( SECTION, "typeof(1)", "number", typeof(1) ); |
| 48 |
new TestCase( SECTION, "typeof(-1)", "number", typeof(-1) ); |
| 49 |
new TestCase( SECTION, "typeof('0')", "string", typeof("0") ); |
| 50 |
new TestCase( SECTION, "typeof(Number())", "number", typeof(Number()) ); |
| 51 |
new TestCase( SECTION, "typeof(Number(0))", "number", typeof(Number(0)) ); |
| 52 |
new TestCase( SECTION, "typeof(Number(1))", "number", typeof(Number(1)) ); |
| 53 |
new TestCase( SECTION, "typeof(Nubmer(-1))", "number", typeof(Number(-1)) ); |
| 54 |
new TestCase( SECTION, "typeof(new Number())", "object", typeof(new Number()) ); |
| 55 |
new TestCase( SECTION, "typeof(new Number(0))", "object", typeof(new Number(0)) ); |
| 56 |
new TestCase( SECTION, "typeof(new Number(1))", "object", typeof(new Number(1)) ); |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
new TestCase( SECTION, "typeof(Math)", "object", typeof(Math) ); |
| 61 |
|
| 62 |
new TestCase( SECTION, "typeof(Number.prototype.toString)", "function", typeof(Number.prototype.toString) ); |
| 63 |
|
| 64 |
new TestCase( SECTION, "typeof('a string')", "string", typeof("a string") ); |
| 65 |
new TestCase( SECTION, "typeof('')", "string", typeof("") ); |
| 66 |
new TestCase( SECTION, "typeof(new Date())", "object", typeof(new Date()) ); |
| 67 |
new TestCase( SECTION, "typeof(new Array(1,2,3))", "object", typeof(new Array(1,2,3)) ); |
| 68 |
new TestCase( SECTION, "typeof(new String('string object'))", "object", typeof(new String("string object")) ); |
| 69 |
new TestCase( SECTION, "typeof(String('string primitive'))", "string", typeof(String("string primitive")) ); |
| 70 |
new TestCase( SECTION, "typeof(['array', 'of', 'strings'])", "object", typeof(["array", "of", "strings"]) ); |
| 71 |
new TestCase( SECTION, "typeof(new Function())", "function", typeof( new Function() ) ); |
| 72 |
new TestCase( SECTION, "typeof(parseInt)", "function", typeof( parseInt ) ); |
| 73 |
new TestCase( SECTION, "typeof(test)", "function", typeof( test ) ); |
| 74 |
new TestCase( SECTION, "typeof(String.fromCharCode)", "function", typeof( String.fromCharCode ) ); |
| 75 |
|
| 76 |
|
| 77 |
test(); |
| 78 |
|