| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 // Test that toLocaleTimeString only returns the time portion of the | 141 // Test that toLocaleTimeString only returns the time portion of the |
| 142 // date without the timezone information. | 142 // date without the timezone information. |
| 143 function testToLocaleTimeString() { | 143 function testToLocaleTimeString() { |
| 144 var d = new Date(); | 144 var d = new Date(); |
| 145 var s = d.toLocaleTimeString(); | 145 var s = d.toLocaleTimeString(); |
| 146 assertEquals(8, s.length); | 146 assertEquals(8, s.length); |
| 147 } | 147 } |
| 148 | 148 |
| 149 testToLocaleTimeString(); | 149 testToLocaleTimeString(); |
| 150 |
| 151 |
| 152 // Modified test from WebKit |
| 153 // LayoutTests/fast/js/script-tests/date-utc-timeclip.js: |
| 154 |
| 155 assertEquals(Date.UTC(275760, 8, 12, 23, 59, 59, 999), 8639999999999999); |
| 156 assertEquals(Date.UTC(275760, 8, 13), 8640000000000000); |
| 157 assertTrue(isNaN(Date.UTC(275760, 8, 13, 0, 0, 0, 1))); |
| 158 assertTrue(isNaN(Date.UTC(275760, 8, 14))); |
| 159 |
| 160 assertEquals(Date.UTC(-271821, 3, 20, 0, 0, 0, 1), -8639999999999999); |
| 161 assertEquals(Date.UTC(-271821, 3, 20), -8640000000000000); |
| 162 assertTrue(isNaN(Date.UTC(-271821, 3, 19, 23, 59, 59, 999))); |
| 163 assertTrue(isNaN(Date.UTC(-271821, 3, 19))); |
| OLD | NEW |