| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = '15.5.4.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
var SECTION = "15.5.4"; |
| 18 |
var VERSION = "ECMA_1"; |
| 19 |
startTest(); |
| 20 |
var TITLE = "Properties of the String Prototype objecta"; |
| 21 |
|
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
|
| 25 |
new TestCase( SECTION, |
| 26 |
"String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()", |
| 27 |
"[object String]", |
| 28 |
eval("String.prototype.getClass = Object.prototype.toString; String.prototype.getClass()") ); |
| 29 |
|
| 30 |
delete String.prototype.getClass; |
| 31 |
|
| 32 |
new TestCase( SECTION, |
| 33 |
"typeof String.prototype", |
| 34 |
"object", |
| 35 |
typeof String.prototype ); |
| 36 |
|
| 37 |
new TestCase( SECTION, |
| 38 |
"String.prototype.valueOf()", |
| 39 |
"", |
| 40 |
String.prototype.valueOf() ); |
| 41 |
|
| 42 |
new TestCase( SECTION, |
| 43 |
"String.prototype +''", |
| 44 |
"", |
| 45 |
String.prototype + '' ); |
| 46 |
|
| 47 |
new TestCase( SECTION, |
| 48 |
"String.prototype.length", |
| 49 |
0, |
| 50 |
String.prototype.length ); |
| 51 |
|
| 52 |
var prop; |
| 53 |
var value; |
| 54 |
|
| 55 |
value = ''; |
| 56 |
for (prop in "") |
| 57 |
{ |
| 58 |
value += prop; |
| 59 |
} |
| 60 |
new TestCase( SECTION, |
| 61 |
'String "" has no enumerable properties', |
| 62 |
'', |
| 63 |
value ); |
| 64 |
|
| 65 |
value = ''; |
| 66 |
for (prop in String.prototype) |
| 67 |
{ |
| 68 |
value += prop; |
| 69 |
} |
| 70 |
new TestCase( SECTION, |
| 71 |
'String.prototype has no enumerable properties', |
| 72 |
'', |
| 73 |
value ); |
| 74 |
|
| 75 |
test(); |