| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = '9.9-1.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
var VERSION = "ECMA_1"; |
| 27 |
startTest(); |
| 28 |
var SECTION = "9.9-1"; |
| 29 |
|
| 30 |
writeHeaderToLog( SECTION + " Type Conversion: ToObject" ); |
| 31 |
|
| 32 |
new TestCase( SECTION, "(Object(true)).__proto__", Boolean.prototype, (Object(true)).__proto__ ); |
| 33 |
|
| 34 |
new TestCase( SECTION, "(Object(true)).__proto__", Boolean.prototype, (Object(true)).__proto__ ); |
| 35 |
|
| 36 |
new TestCase( SECTION, "(Object(0)).__proto__", Number.prototype, (Object(0)).__proto__ ); |
| 37 |
|
| 38 |
new TestCase( SECTION, "(Object(-0)).__proto__", Number.prototype, (Object(-0)).__proto__ ); |
| 39 |
|
| 40 |
new TestCase( SECTION, "(Object(1)).__proto__", Number.prototype, (Object(1)).__proto__ ); |
| 41 |
|
| 42 |
new TestCase( SECTION, "(Object(-1)).__proto__", Number.prototype, (Object(-1)).__proto__ ); |
| 43 |
|
| 44 |
new TestCase( SECTION, "(Object(Number.MAX_VALUE)).__proto__", Number.prototype, (Object(Number.MAX_VALUE)).__proto__ ); |
| 45 |
|
| 46 |
new TestCase( SECTION, "(Object(Number.MIN_VALUE)).__proto__", Number.prototype, (Object(Number.MIN_VALUE)).__proto__ ); |
| 47 |
|
| 48 |
new TestCase( SECTION, "(Object(Number.POSITIVE_INFINITY)).__proto__", Number.prototype, (Object(Number.POSITIVE_INFINITY)).__proto__ ); |
| 49 |
|
| 50 |
new TestCase( SECTION, "(Object(Number.NEGATIVE_INFINITY)).__proto__", Number.prototype, (Object(Number.NEGATIVE_INFINITY)).__proto__ ); |
| 51 |
|
| 52 |
new TestCase( SECTION, "(Object(Number.NaN)).__proto__", Number.prototype, (Object(Number.NaN)).__proto__ ); |
| 53 |
|
| 54 |
new TestCase( SECTION, "(Object('a string')).__proto__", String.prototype, (Object("a string")).__proto__ ); |
| 55 |
|
| 56 |
new TestCase( SECTION, "(Object('')).__proto__", String.prototype, (Object("")).__proto__ ); |
| 57 |
|
| 58 |
new TestCase( SECTION, "(Object('\\r\\t\\b\\n\\v\\f')).__proto__", String.prototype, (Object("\\r\\t\\b\\n\\v\\f")).__proto__ ); |
| 59 |
|
| 60 |
new TestCase( SECTION, "Object( '\\\'\\\"\\' ).__proto__", String.prototype, (Object("\'\"\\")).__proto__ ); |
| 61 |
|
| 62 |
new TestCase( SECTION, "(Object( new MyObject(true) )).toString()", "[object Object]", eval("(Object( new MyObject(true) )).toString()") ); |
| 63 |
|
| 64 |
test(); |
| 65 |
|
| 66 |
function MyObject( value ) { |
| 67 |
this.value = value; |
| 68 |
this.valueOf = new Function ( "return this.value" ); |
| 69 |
} |