Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: test/mjsunit/date.js

Issue 1579613002: [builtins] Refactor the remaining Date builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: As per offline discussion, remove the weird test, which does not add a lot of value. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-date.cc ('k') | test/mjsunit/debug-script.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 var k = new Date(); 139 var k = new Date();
140 k.setMilliseconds(); 140 k.setMilliseconds();
141 k.setMilliseconds(2); 141 k.setMilliseconds(2);
142 assertTrue(isNaN(k.getMilliseconds())); 142 assertTrue(isNaN(k.getMilliseconds()));
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
150 // date without the timezone information.
151 function testToLocaleTimeString() {
152 var d = new Date();
153 var s = d.toLocaleTimeString("en-GB");
154 assertEquals(8, s.length);
155 }
156
157 testToLocaleTimeString();
158
159 // Test that -0 is treated correctly in MakeDay. 149 // Test that -0 is treated correctly in MakeDay.
160 var d = new Date(); 150 var d = new Date();
161 assertDoesNotThrow("d.setDate(-0)"); 151 assertDoesNotThrow("d.setDate(-0)");
162 assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0, -0)"); 152 assertDoesNotThrow("new Date(-0, -0, -0, -0, -0, -0, -0)");
163 assertDoesNotThrow("new Date(0x40000000, 0x40000000, 0x40000000," + 153 assertDoesNotThrow("new Date(0x40000000, 0x40000000, 0x40000000," +
164 "0x40000000, 0x40000000, 0x40000000, 0x40000000)") 154 "0x40000000, 0x40000000, 0x40000000, 0x40000000)")
165 assertDoesNotThrow("new Date(-0x40000001, -0x40000001, -0x40000001," + 155 assertDoesNotThrow("new Date(-0x40000001, -0x40000001, -0x40000001," +
166 "-0x40000001, -0x40000001, -0x40000001, -0x40000001)") 156 "-0x40000001, -0x40000001, -0x40000001, -0x40000001)")
167 157
168 158
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 delete Date.prototype.getUTCHours; 335 delete Date.prototype.getUTCHours;
346 delete Date.prototype.getUTCMinutes; 336 delete Date.prototype.getUTCMinutes;
347 delete Date.prototype.getUTCSeconds; 337 delete Date.prototype.getUTCSeconds;
348 delete Date.prototype.getUTCMilliseconds; 338 delete Date.prototype.getUTCMilliseconds;
349 (new Date()).toISOString(); 339 (new Date()).toISOString();
350 340
351 (function TestDeleteToString() { 341 (function TestDeleteToString() {
352 assertTrue(delete Date.prototype.toString); 342 assertTrue(delete Date.prototype.toString);
353 assertTrue('[object Date]' !== Date()); 343 assertTrue('[object Date]' !== Date());
354 })(); 344 })();
OLDNEW
« no previous file with comments | « test/cctest/test-date.cc ('k') | test/mjsunit/debug-script.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698