| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-301738-01.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 301738; |
| 9 |
var summary = 'Date parse compatibilty with MSIE'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
|
| 13 |
printBugNumber(BUGNUMBER); |
| 14 |
printStatus (summary); |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
var month = 'January'; |
| 28 |
var f; |
| 29 |
var l; |
| 30 |
|
| 31 |
f = l = 0; |
| 32 |
expect = true; |
| 33 |
|
| 34 |
actual = isNaN(new Date(month + ' ' + f + ' ' + l)); |
| 35 |
reportCompare(expect, actual, 'January 0 0 is invalid'); |
| 36 |
|
| 37 |
actual = isNaN(new Date(f + ' ' + l + ' ' + month)); |
| 38 |
reportCompare(expect, actual, '0 0 January is invalid'); |
| 39 |
|
| 40 |
actual = isNaN(new Date(f + ' ' + month + ' ' + l)); |
| 41 |
reportCompare(expect, actual, '0 January 0 is invalid'); |
| 42 |
|
| 43 |
f = l = 70; |
| 44 |
|
| 45 |
actual = isNaN(new Date(month + ' ' + f + ' ' + l)); |
| 46 |
reportCompare(expect, actual, 'January 70 70 is invalid'); |
| 47 |
|
| 48 |
actual = isNaN(new Date(f + ' ' + l + ' ' + month)); |
| 49 |
reportCompare(expect, actual, '70 70 January is invalid'); |
| 50 |
|
| 51 |
actual = isNaN(new Date(f + ' ' + month + ' ' + l)); |
| 52 |
reportCompare(expect, actual, '70 January 70 is invalid'); |
| 53 |
|
| 54 |
f = 100; |
| 55 |
l = 15; |
| 56 |
|
| 57 |
|
| 58 |
expect = new Date(f, 0, l).toString(); |
| 59 |
|
| 60 |
actual = new Date(month + ' ' + f + ' ' + l).toString(); |
| 61 |
reportCompare(expect, actual, 'month f l'); |
| 62 |
|
| 63 |
actual = new Date(f + ' ' + l + ' ' + month).toString(); |
| 64 |
reportCompare(expect, actual, 'f l month'); |
| 65 |
|
| 66 |
actual = new Date(f + ' ' + month + ' ' + l).toString(); |
| 67 |
reportCompare(expect, actual, 'f month l'); |
| 68 |
|
| 69 |
f = 80; |
| 70 |
l = 15; |
| 71 |
|
| 72 |
|
| 73 |
expect = (new Date(f, 0, l)).toString(); |
| 74 |
|
| 75 |
actual = (new Date(month + ' ' + f + ' ' + l)).toString(); |
| 76 |
reportCompare(expect, actual, 'month f l'); |
| 77 |
|
| 78 |
actual = (new Date(f + ' ' + l + ' ' + month)).toString(); |
| 79 |
reportCompare(expect, actual, 'f l month'); |
| 80 |
|
| 81 |
actual = (new Date(f + ' ' + month + ' ' + l)).toString(); |
| 82 |
reportCompare(expect, actual, 'f month l'); |
| 83 |
|
| 84 |
f = 2040; |
| 85 |
l = 15; |
| 86 |
|
| 87 |
|
| 88 |
expect = (new Date(f, 0, l)).toString(); |
| 89 |
|
| 90 |
actual = (new Date(month + ' ' + f + ' ' + l)).toString(); |
| 91 |
reportCompare(expect, actual, 'month f l'); |
| 92 |
|
| 93 |
actual = (new Date(f + ' ' + l + ' ' + month)).toString(); |
| 94 |
reportCompare(expect, actual, 'f l month'); |
| 95 |
|
| 96 |
actual = (new Date(f + ' ' + month + ' ' + l)).toString(); |
| 97 |
reportCompare(expect, actual, 'f month l'); |
| 98 |
|