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

Side by Side Diff: src/date.js

Issue 1200033003: Date() should not depend on Date.prototype.toString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 5 years, 6 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 | « no previous file | test/mjsunit/date.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var $createDate; 5 var $createDate;
6 6
7 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 8
9 (function(global, utils) { 9 (function(global, utils) {
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Cached time value. 126 // Cached time value.
127 time: 0, 127 time: 0,
128 // String input for which the cached time is valid. 128 // String input for which the cached time is valid.
129 string: null 129 string: null
130 }; 130 };
131 131
132 132
133 function DateConstructor(year, month, date, hours, minutes, seconds, ms) { 133 function DateConstructor(year, month, date, hours, minutes, seconds, ms) {
134 if (!%_IsConstructCall()) { 134 if (!%_IsConstructCall()) {
135 // ECMA 262 - 15.9.2 135 // ECMA 262 - 15.9.2
136 return (new GlobalDate()).toString(); 136 return %_CallFunction(new GlobalDate(), DateToString);
137 } 137 }
138 138
139 // ECMA 262 - 15.9.3 139 // ECMA 262 - 15.9.3
140 var argc = %_ArgumentsLength(); 140 var argc = %_ArgumentsLength();
141 var value; 141 var value;
142 if (argc == 0) { 142 if (argc == 0) {
143 value = %DateCurrentTime(); 143 value = %DateCurrentTime();
144 SET_UTC_DATE_VALUE(this, value); 144 SET_UTC_DATE_VALUE(this, value);
145 } else if (argc == 1) { 145 } else if (argc == 1) {
146 if (IS_NUMBER(year)) { 146 if (IS_NUMBER(year)) {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 "getYear", DateGetYear, 877 "getYear", DateGetYear,
878 "setYear", DateSetYear, 878 "setYear", DateSetYear,
879 "toISOString", DateToISOString, 879 "toISOString", DateToISOString,
880 "toJSON", DateToJSON 880 "toJSON", DateToJSON
881 ]); 881 ]);
882 882
883 // Expose to the global scope. 883 // Expose to the global scope.
884 $createDate = CreateDate; 884 $createDate = CreateDate;
885 885
886 }) 886 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698