| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = '15.5.4.5-5.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
var SECTION = "15.5.4.5-5"; |
| 39 |
var VERSION = "ECMA_1"; |
| 40 |
startTest(); |
| 41 |
var TITLE = "String.prototype.charCodeAt"; |
| 42 |
|
| 43 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 44 |
|
| 45 |
var TEST_STRING = ""; |
| 46 |
|
| 47 |
for ( var i = 0x0000; i < 255; i++ ) { |
| 48 |
TEST_STRING += String.fromCharCode( i ); |
| 49 |
} |
| 50 |
|
| 51 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)", 0x0074, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(0)") ); |
| 52 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)", 0x0072, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(1)") ); |
| 53 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)", 0x0075, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(2)") ); |
| 54 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)", 0x0065, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(3)") ); |
| 55 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)", Number.NaN, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(4)") ); |
| 56 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)", Number.NaN, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(-1)") ); |
| 57 |
|
| 58 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)", 0x0072, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(true)") ); |
| 59 |
new TestCase( SECTION, "x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)", 0x0074, eval("x = new Boolean(true); x.charCodeAt=String.prototype.charCodeAt;x.charCodeAt(false)") ); |
| 60 |
|
| 61 |
new TestCase( SECTION, "x = new String(); x.charCodeAt(0)", Number.NaN, eval("x=new String();x.charCodeAt(0)") ); |
| 62 |
new TestCase( SECTION, "x = new String(); x.charCodeAt(1)", Number.NaN, eval("x=new String();x.charCodeAt(1)") ); |
| 63 |
new TestCase( SECTION, "x = new String(); x.charCodeAt(-1)", Number.NaN, eval("x=new String();x.charCodeAt(-1)") ); |
| 64 |
|
| 65 |
new TestCase( SECTION, "x = new String(); x.charCodeAt(NaN)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NaN)") ); |
| 66 |
new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.POSITIVE_INFINITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.POSITIVE_INFINITY)") ); |
| 67 |
new TestCase( SECTION, "x = new String(); x.charCodeAt(Number.NEGATIVE_INFINITY)", Number.NaN, eval("x=new String();x.charCodeAt(Number.NEGATIVE_INFINITY)") ); |
| 68 |
|
| 69 |
for ( var j = 0; j < 255; j++ ) { |
| 70 |
new TestCase( SECTION, "TEST_STRING.charCodeAt("+j+")", j, TEST_STRING.charCodeAt(j) ); |
| 71 |
} |
| 72 |
|
| 73 |
test(); |