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

Side by Side Diff: src/js/date.js

Issue 1490783002: [bootstrapper] add checks for variable bindings in native scripts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « src/d8.cc ('k') | src/parsing/parser.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 // ------------------------------------------------------------------- 5 // -------------------------------------------------------------------
6 6
7 (function(global, utils) { 7 (function(global, utils) {
8 8
9 "use strict"; 9 "use strict";
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (!IsFinite(min)) return NaN; 63 if (!IsFinite(min)) return NaN;
64 if (!IsFinite(sec)) return NaN; 64 if (!IsFinite(sec)) return NaN;
65 if (!IsFinite(ms)) return NaN; 65 if (!IsFinite(ms)) return NaN;
66 return TO_INTEGER(hour) * msPerHour 66 return TO_INTEGER(hour) * msPerHour
67 + TO_INTEGER(min) * msPerMinute 67 + TO_INTEGER(min) * msPerMinute
68 + TO_INTEGER(sec) * msPerSecond 68 + TO_INTEGER(sec) * msPerSecond
69 + TO_INTEGER(ms); 69 + TO_INTEGER(ms);
70 } 70 }
71 71
72 72
73 // ECMA 262 - 15.9.1.12
74 function TimeInYear(year) {
75 return DaysInYear(year) * msPerDay;
76 }
77
78
79 // Compute number of days given a year, month, date. 73 // Compute number of days given a year, month, date.
80 // Note that month and date can lie outside the normal range. 74 // Note that month and date can lie outside the normal range.
81 // For example: 75 // For example:
82 // MakeDay(2007, -4, 20) --> MakeDay(2006, 8, 20) 76 // MakeDay(2007, -4, 20) --> MakeDay(2006, 8, 20)
83 // MakeDay(2007, -33, 1) --> MakeDay(2004, 3, 1) 77 // MakeDay(2007, -33, 1) --> MakeDay(2004, 3, 1)
84 // MakeDay(2007, 14, -50) --> MakeDay(2007, 8, 11) 78 // MakeDay(2007, 14, -50) --> MakeDay(2007, 8, 11)
85 function MakeDay(year, month, date) { 79 function MakeDay(year, month, date) {
86 if (!IsFinite(year) || !IsFinite(month) || !IsFinite(date)) return NaN; 80 if (!IsFinite(year) || !IsFinite(month) || !IsFinite(date)) return NaN;
87 81
88 // Convert to integer and map -0 to 0. 82 // Convert to integer and map -0 to 0.
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 "toUTCString", DateToUTCString, 875 "toUTCString", DateToUTCString,
882 "getYear", DateGetYear, 876 "getYear", DateGetYear,
883 "setYear", DateSetYear, 877 "setYear", DateSetYear,
884 "toISOString", DateToISOString, 878 "toISOString", DateToISOString,
885 "toJSON", DateToJSON 879 "toJSON", DateToJSON
886 ]); 880 ]);
887 881
888 %InstallToContext(["create_date_fun", CreateDate]); 882 %InstallToContext(["create_date_fun", CreateDate]);
889 883
890 }) 884 })
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698