| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-387501.js'; |
| 7 |
|
| 8 |
|
| 9 |
var BUGNUMBER = 387501; |
| 10 |
var summary = 'Array.prototype.toString|toSource|toLocaleString is not generic'; |
| 11 |
var actual = ''; |
| 12 |
var expect = ''; |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
test(); |
| 17 |
|
| 18 |
|
| 19 |
function test() |
| 20 |
{ |
| 21 |
enterFunc ('test'); |
| 22 |
printBugNumber(BUGNUMBER); |
| 23 |
printStatus (summary); |
| 24 |
|
| 25 |
try |
| 26 |
{ |
| 27 |
expect = 'TypeError: Array.prototype.toString called on incompatible String'; |
| 28 |
actual = Array.prototype.toString.call((new String('foo'))); |
| 29 |
} |
| 30 |
catch(ex) |
| 31 |
{ |
| 32 |
actual = ex + ''; |
| 33 |
} |
| 34 |
reportCompare(expect, actual, summary); |
| 35 |
|
| 36 |
try |
| 37 |
{ |
| 38 |
expect = 'TypeError: Array.prototype.toLocaleString called on incompatible String'; |
| 39 |
actual = Array.prototype.toLocaleString.call((new String('foo'))); |
| 40 |
} |
| 41 |
catch(ex) |
| 42 |
{ |
| 43 |
actual = ex + ''; |
| 44 |
} |
| 45 |
reportCompare(expect, actual, summary); |
| 46 |
|
| 47 |
if (typeof Array.prototype.toSource != 'undefined') |
| 48 |
{ |
| 49 |
try |
| 50 |
{ |
| 51 |
expect = 'TypeError: Array.prototype.toSource called on incompatible String'; |
| 52 |
actual = Array.prototype.toSource.call((new String('foo'))); |
| 53 |
} |
| 54 |
catch(ex) |
| 55 |
{ |
| 56 |
actual = ex + ''; |
| 57 |
} |
| 58 |
reportCompare(expect, actual, summary); |
| 59 |
} |
| 60 |
|
| 61 |
exitFunc ('test'); |
| 62 |
} |