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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 var l = new Date(); | 144 var l = new Date(); |
145 l.setUTCMilliseconds(); | 145 l.setUTCMilliseconds(); |
146 l.setUTCMilliseconds(2); | 146 l.setUTCMilliseconds(2); |
147 assertTrue(isNaN(l.getUTCMilliseconds())); | 147 assertTrue(isNaN(l.getUTCMilliseconds())); |
148 | 148 |
149 // Test that toLocaleTimeString only returns the time portion of the | 149 // Test that toLocaleTimeString only returns the time portion of the |
150 // date without the timezone information. | 150 // date without the timezone information. |
151 function testToLocaleTimeString() { | 151 function testToLocaleTimeString() { |
152 var d = new Date(); | 152 var d = new Date(); |
153 var s = d.toLocaleTimeString(); | 153 var s = d.toLocaleTimeString("en-GB"); |
154 assertEquals(8, s.length); | 154 assertEquals(8, s.length); |
155 } | 155 } |
156 | 156 |
157 testToLocaleTimeString(); | 157 testToLocaleTimeString(); |
158 | 158 |
159 // Test that -0 is treated correctly in MakeDay. | 159 // Test that -0 is treated correctly in MakeDay. |
160 var d = new Date(); | 160 var d = new Date(); |
161 assertDoesNotThrow("d.setDate(-0)"); | 161 assertDoesNotThrow("d.setDate(-0)"); |
162 assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0, -0)"); | 162 assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0, -0)"); |
163 assertDoesNotThrow("new Date(0x40000000, 0x40000000, 0x40000000," + | 163 assertDoesNotThrow("new Date(0x40000000, 0x40000000, 0x40000000," + |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 date.getTime(); | 333 date.getTime(); |
334 %OptimizeFunctionOnNextCall(Date.prototype.getTime); | 334 %OptimizeFunctionOnNextCall(Date.prototype.getTime); |
335 assertThrows(function() { Date.prototype.getTime.call(""); }, TypeError); | 335 assertThrows(function() { Date.prototype.getTime.call(""); }, TypeError); |
336 assertTrue(%GetOptimizationStatus(Date.prototype.getTime) != 1); | 336 assertTrue(%GetOptimizationStatus(Date.prototype.getTime) != 1); |
337 | 337 |
338 date.getYear(); | 338 date.getYear(); |
339 date.getYear(); | 339 date.getYear(); |
340 %OptimizeFunctionOnNextCall(Date.prototype.getYear); | 340 %OptimizeFunctionOnNextCall(Date.prototype.getYear); |
341 assertThrows(function() { Date.prototype.getYear.call(""); }, TypeError); | 341 assertThrows(function() { Date.prototype.getYear.call(""); }, TypeError); |
342 opt_status = %GetOptimizationStatus(Date.prototype.getYear); | 342 opt_status = %GetOptimizationStatus(Date.prototype.getYear); |
343 assertTrue(%GetOptimizationStatus(Date.prototype.getTime) != 1); | 343 assertTrue(%GetOptimizationStatus(Date.prototype.getTime) != 1); |
OLD | NEW |