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; |