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

Side by Side Diff: src/date.js

Issue 1116953002: Migrate error messages, part 6. (string.js and date.js) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 5 years, 7 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 | src/messages.h » ('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 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in v8natives.js: 6 // in v8natives.js:
7 // var $isFinite = GlobalIsFinite; 7 // var $isFinite = GlobalIsFinite;
8 8
9 var $createDate; 9 var $createDate;
10 10
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 684
685 function PadInt(n, digits) { 685 function PadInt(n, digits) {
686 if (digits == 1) return n; 686 if (digits == 1) return n;
687 return n < %_MathPow(10, digits - 1) ? '0' + PadInt(n, digits - 1) : n; 687 return n < %_MathPow(10, digits - 1) ? '0' + PadInt(n, digits - 1) : n;
688 } 688 }
689 689
690 690
691 // ECMA 262 - 15.9.5.43 691 // ECMA 262 - 15.9.5.43
692 function DateToISOString() { 692 function DateToISOString() {
693 var t = UTC_DATE_VALUE(this); 693 var t = UTC_DATE_VALUE(this);
694 if (NUMBER_IS_NAN(t)) throw MakeRangeError("invalid_time_value", []); 694 if (NUMBER_IS_NAN(t)) throw MakeRangeError(kInvalidTimeValue);
695 var year = this.getUTCFullYear(); 695 var year = this.getUTCFullYear();
696 var year_string; 696 var year_string;
697 if (year >= 0 && year <= 9999) { 697 if (year >= 0 && year <= 9999) {
698 year_string = PadInt(year, 4); 698 year_string = PadInt(year, 4);
699 } else { 699 } else {
700 if (year < 0) { 700 if (year < 0) {
701 year_string = "-" + PadInt(-year, 6); 701 year_string = "-" + PadInt(-year, 6);
702 } else { 702 } else {
703 year_string = "+" + PadInt(year, 6); 703 year_string = "+" + PadInt(year, 6);
704 } 704 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 "getYear", DateGetYear, 817 "getYear", DateGetYear,
818 "setYear", DateSetYear, 818 "setYear", DateSetYear,
819 "toISOString", DateToISOString, 819 "toISOString", DateToISOString,
820 "toJSON", DateToJSON 820 "toJSON", DateToJSON
821 ]); 821 ]);
822 822
823 // Expose to the global scope. 823 // Expose to the global scope.
824 $createDate = CreateDate; 824 $createDate = CreateDate;
825 825
826 })(); 826 })();
OLDNEW
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698