| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = '15.9.5.5-02.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 398485; |
| 9 |
var summary = 'Date.prototype.toLocaleString should not clamp year'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
test(); |
| 16 |
|
| 17 |
|
| 18 |
function test() |
| 19 |
{ |
| 20 |
enterFunc ('test'); |
| 21 |
printBugNumber(BUGNUMBER); |
| 22 |
printStatus (summary); |
| 23 |
|
| 24 |
var d; |
| 25 |
var y; |
| 26 |
var l; |
| 27 |
var maxms = 8640000000000000; |
| 28 |
|
| 29 |
d = new Date(-maxms ); |
| 30 |
y = d.getFullYear(); |
| 31 |
l = d.toLocaleString(); |
| 32 |
print(l); |
| 33 |
|
| 34 |
actual = y; |
| 35 |
expect = -271821; |
| 36 |
reportCompare(expect, actual, summary + ': check year'); |
| 37 |
|
| 38 |
actual = l.match(new RegExp(y)) + ''; |
| 39 |
expect = y + ''; |
| 40 |
reportCompare(expect, actual, summary + ': check toLocaleString'); |
| 41 |
|
| 42 |
d = new Date(maxms ); |
| 43 |
y = d.getFullYear(); |
| 44 |
l = d.toLocaleString(); |
| 45 |
print(l); |
| 46 |
|
| 47 |
actual = y; |
| 48 |
expect = 275760; |
| 49 |
reportCompare(expect, actual, summary + ': check year'); |
| 50 |
|
| 51 |
actual = l.match(new RegExp(y)) + ''; |
| 52 |
expect = y + ''; |
| 53 |
reportCompare(expect, actual, summary + ': check toLocaleString'); |
| 54 |
|
| 55 |
exitFunc ('test'); |
| 56 |
} |