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

Unified Diff: src/harmony-array.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/generator.js ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index 93f32a82b299b3a54729650a2497c88c9fafe5df..00a1fa07eed3c69390bf6753bacf4b6dfbe897ea 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -8,43 +8,54 @@ var $innerArrayFind;
var $innerArrayFindIndex;
var $arrayFrom;
-(function(global, exports) {
+(function(global, utils) {
'use strict';
%CheckIsBootstrapping();
+// -------------------------------------------------------------------
+// Imports
+
var GlobalArray = global.Array;
var GlobalSymbol = global.Symbol;
+var MathMax;
+var MathMin;
+
+utils.Import(function(from) {
+ MathMax = from.MathMax;
+ MathMin = from.MathMin;
+});
+
// -------------------------------------------------------------------
function InnerArrayCopyWithin(target, start, end, array, length) {
target = TO_INTEGER(target);
var to;
if (target < 0) {
- to = $max(length + target, 0);
+ to = MathMax(length + target, 0);
} else {
- to = $min(target, length);
+ to = MathMin(target, length);
}
start = TO_INTEGER(start);
var from;
if (start < 0) {
- from = $max(length + start, 0);
+ from = MathMax(length + start, 0);
} else {
- from = $min(start, length);
+ from = MathMin(start, length);
}
end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
var final;
if (end < 0) {
- final = $max(length + end, 0);
+ final = MathMax(length + end, 0);
} else {
- final = $min(end, length);
+ final = MathMin(end, length);
}
- var count = $min(final - from, length - to);
+ var count = MathMin(final - from, length - to);
var direction = 1;
if (from < to && to < (from + count)) {
direction = -1;
« no previous file with comments | « src/generator.js ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698