Index: src/harmony-array.js |
diff --git a/src/harmony-array.js b/src/harmony-array.js |
index 4cea1a4649e1baea9e0426e39e7aaba63d41862f..61bdbb689eed3e7a58c18c1a445da41e3d9eeb55 100644 |
--- a/src/harmony-array.js |
+++ b/src/harmony-array.js |
@@ -15,12 +15,16 @@ |
var GetMethod; |
var GlobalArray = global.Array; |
var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
+var MathMax; |
+var MathMin; |
var ObjectIsFrozen; |
var ObjectDefineProperty; |
utils.Import(function(from) { |
GetIterator = from.GetIterator; |
GetMethod = from.GetMethod; |
+ MathMax = from.MathMax; |
+ MathMin = from.MathMin; |
ObjectIsFrozen = from.ObjectIsFrozen; |
ObjectDefineProperty = from.ObjectDefineProperty; |
}); |
@@ -31,28 +35,28 @@ |
target = TO_INTEGER(target); |
var to; |
if (target < 0) { |
- to = MAX_SIMPLE(length + target, 0); |
- } else { |
- to = MIN_SIMPLE(target, length); |
+ to = MathMax(length + target, 0); |
+ } else { |
+ to = MathMin(target, length); |
} |
start = TO_INTEGER(start); |
var from; |
if (start < 0) { |
- from = MAX_SIMPLE(length + start, 0); |
- } else { |
- from = MIN_SIMPLE(start, length); |
+ from = MathMax(length + start, 0); |
+ } else { |
+ from = MathMin(start, length); |
} |
end = IS_UNDEFINED(end) ? length : TO_INTEGER(end); |
var final; |
if (end < 0) { |
- final = MAX_SIMPLE(length + end, 0); |
- } else { |
- final = MIN_SIMPLE(end, length); |
- } |
- |
- var count = MIN_SIMPLE(final - from, length - to); |
+ final = MathMax(length + end, 0); |
+ } else { |
+ final = MathMin(end, length); |
+ } |
+ |
+ var count = MathMin(final - from, length - to); |
var direction = 1; |
if (from < to && to < (from + count)) { |
direction = -1; |