Reviewers: Mads Ager, antonm,

Description:
Revert change to EquivalentTime in date.js. The checks that I've removed in the
last changed were essential after all.


Please review this at http://codereview.chromium.org/660375

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/date-delay.js
  M     src/runtime.cc


Index: src/date-delay.js
===================================================================
--- src/date-delay.js   (revision 3997)
+++ src/date-delay.js   (working copy)
@@ -114,11 +114,9 @@
   // the actual year if it is in the range 1970..2037
   if (t >= 0 && t <= 2.1e12) return t;

- // We call the function from runtime.cc directly to avoid extra checks which
-  // are unneeded.
-  var day = %DateMakeDay(EquivalentYear(YEAR_FROM_TIME(t)),
-                         MONTH_FROM_TIME(t),
-                         DATE_FROM_TIME(t));
+  var day = MakeDay(EquivalentYear(YEAR_FROM_TIME(t)),
+                    MONTH_FROM_TIME(t),
+                    DATE_FROM_TIME(t));
   return MakeDate(day, TimeWithinDay(t));
 }

Index: src/runtime.cc
===================================================================
--- src/runtime.cc      (revision 3997)
+++ src/runtime.cc      (working copy)
@@ -4944,6 +4944,9 @@
 static Object* Runtime_DateMakeDay(Arguments args) {
   NoHandleAllocation ha;
   ASSERT(args.length() == 3);
+  ASSERT(args[0]->IsSmi());
+  ASSERT(args[1]->IsSmi());
+  ASSERT(args[2]->IsSmi());

   CONVERT_SMI_CHECKED(year, args[0]);
   CONVERT_SMI_CHECKED(month, args[1]);


--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to