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

Unified Diff: src/date.js

Issue 1143993003: Use shared container to manage imports/exports. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed test for no-snap 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/contexts.h ('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 7b6f539eaa356dd692c4dda3eb96bb67bbef3493..3adf94d21697026fa1b585fadca059c2162840ac 100644
--- a/src/date.js
+++ b/src/date.js
@@ -10,7 +10,7 @@ var $createDate;
// -------------------------------------------------------------------
-(function(global, shared, exports) {
+(function(global, utils) {
"use strict";
@@ -20,7 +20,15 @@ var $createDate;
// Imports
var GlobalDate = global.Date;
-var InternalArray = shared.InternalArray;
+var InternalArray = utils.InternalArray;
+
+var MathAbs;
+var MathFloor;
+
+utils.Import(function(from) {
+ MathAbs = from.MathAbs;
+ MathFloor = from.MathFloor;
+});
// -------------------------------------------------------------------
@@ -101,7 +109,7 @@ function MakeDate(day, time) {
// is no way that the time can be within range even after UTC
// conversion we return NaN immediately instead of relying on
// TimeClip to do it.
- if ($abs(time) > MAX_TIME_BEFORE_UTC) return NAN;
+ if (MathAbs(time) > MAX_TIME_BEFORE_UTC) return NAN;
return time;
}
@@ -109,7 +117,7 @@ function MakeDate(day, time) {
// ECMA 262 - 15.9.1.14
function TimeClip(time) {
if (!$isFinite(time)) return NAN;
- if ($abs(time) > MAX_TIME_MS) return NAN;
+ if (MathAbs(time) > MAX_TIME_MS) return NAN;
return TO_INTEGER(time);
}
@@ -236,8 +244,8 @@ function LocalTimezoneString(date) {
var timezoneOffset = -TIMEZONE_OFFSET(date);
var sign = (timezoneOffset >= 0) ? 1 : -1;
- var hours = $floor((sign * timezoneOffset)/60);
- var min = $floor((sign * timezoneOffset)%60);
+ var hours = MathFloor((sign * timezoneOffset)/60);
+ var min = MathFloor((sign * timezoneOffset)%60);
var gmt = ' GMT' + ((sign == 1) ? '+' : '-') +
TwoDigitString(hours) + TwoDigitString(min);
return gmt + ' (' + timezone + ')';
« no previous file with comments | « src/contexts.h ('k') | src/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698