Index: src/date.js |
diff --git a/src/date.js b/src/date.js |
index 3d494a136466dcf974cea107bf6b92ff82dda9c7..3adf94d21697026fa1b585fadca059c2162840ac 100644 |
--- a/src/date.js |
+++ b/src/date.js |
@@ -2,6 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+// This file relies on the fact that the following declarations have been made |
+// in v8natives.js: |
+// var $isFinite = GlobalIsFinite; |
+ |
var $createDate; |
// ------------------------------------------------------------------- |
@@ -18,12 +22,10 @@ |
var GlobalDate = global.Date; |
var InternalArray = utils.InternalArray; |
-var IsFinite; |
var MathAbs; |
var MathFloor; |
utils.Import(function(from) { |
- IsFinite = from.IsFinite; |
MathAbs = from.MathAbs; |
MathFloor = from.MathFloor; |
}); |
@@ -58,10 +60,10 @@ |
// ECMA 262 - 15.9.1.11 |
function MakeTime(hour, min, sec, ms) { |
- if (!IsFinite(hour)) return NAN; |
- if (!IsFinite(min)) return NAN; |
- if (!IsFinite(sec)) return NAN; |
- if (!IsFinite(ms)) return NAN; |
+ if (!$isFinite(hour)) return NAN; |
+ if (!$isFinite(min)) return NAN; |
+ if (!$isFinite(sec)) return NAN; |
+ if (!$isFinite(ms)) return NAN; |
return TO_INTEGER(hour) * msPerHour |
+ TO_INTEGER(min) * msPerMinute |
+ TO_INTEGER(sec) * msPerSecond |
@@ -82,7 +84,7 @@ |
// MakeDay(2007, -33, 1) --> MakeDay(2004, 3, 1) |
// MakeDay(2007, 14, -50) --> MakeDay(2007, 8, 11) |
function MakeDay(year, month, date) { |
- if (!IsFinite(year) || !IsFinite(month) || !IsFinite(date)) return NAN; |
+ if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return NAN; |
// Convert to integer and map -0 to 0. |
year = TO_INTEGER_MAP_MINUS_ZERO(year); |
@@ -114,7 +116,7 @@ |
// ECMA 262 - 15.9.1.14 |
function TimeClip(time) { |
- if (!IsFinite(time)) return NAN; |
+ if (!$isFinite(time)) return NAN; |
if (MathAbs(time) > MAX_TIME_MS) return NAN; |
return TO_INTEGER(time); |
} |
@@ -772,7 +774,7 @@ |
%FunctionSetPrototype(GlobalDate, new GlobalDate(NAN)); |
// Set up non-enumerable properties of the Date object itself. |
-utils.InstallFunctions(GlobalDate, DONT_ENUM, [ |
+$installFunctions(GlobalDate, DONT_ENUM, [ |
"UTC", DateUTC, |
"parse", DateParse, |
"now", DateNow |
@@ -783,7 +785,7 @@ |
// Set up non-enumerable functions of the Date prototype object and |
// set their names. |
-utils.InstallFunctions(GlobalDate.prototype, DONT_ENUM, [ |
+$installFunctions(GlobalDate.prototype, DONT_ENUM, [ |
"toString", DateToString, |
"toDateString", DateToDateString, |
"toTimeString", DateToTimeString, |