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

Unified Diff: src/date.js

Issue 1154743003: Revert of Hook up more import/exports in natives. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/collection-iterator.js ('k') | src/generator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/collection-iterator.js ('k') | src/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698