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

Unified Diff: src/macros.py

Issue 9117034: New class for Date objects: caches individual date components. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: src/macros.py
diff --git a/src/macros.py b/src/macros.py
index 8e9c62dbe580132856943703d802b0a4c992709d..dcc414b178a4a4ac232211476e4d1994ed4a2c46 100644
--- a/src/macros.py
+++ b/src/macros.py
@@ -164,7 +164,8 @@ const MAX_TIME_BEFORE_UTC = 8640002592000000;
# Gets the value of a Date object. If arg is not a Date object
# a type error is thrown.
-macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_ValueOf(arg) : ThrowDateTypeError());
+macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_DateField(arg, -1) : ThrowDateTypeError());
+macro SET_DATE_VALUE(arg, value) = (%_SetDateField(arg, -1, value));
macro DAY(time) = ($floor(time / 86400000));
macro NAN_OR_DATE_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : DateFromTime(time));
macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24));

Powered by Google App Engine
This is Rietveld 408576698