Index: src/arraybuffer.js |
diff --git a/src/arraybuffer.js b/src/arraybuffer.js |
index 3e6e084a7bee0559c5080ca7a5239af49bd8fb17..eebf2f7bc90ea28e8eb2ff73c683bc8fc69f38b1 100644 |
--- a/src/arraybuffer.js |
+++ b/src/arraybuffer.js |
@@ -2,15 +2,27 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-(function(global, shared, exports) { |
+(function(global, utils) { |
"use strict"; |
%CheckIsBootstrapping(); |
+ |
+// ------------------------------------------------------------------- |
+// Imports |
+ |
var GlobalArrayBuffer = global.ArrayBuffer; |
var GlobalObject = global.Object; |
+var MathMax; |
+var MathMin; |
+ |
+utils.Import(function(from) { |
+ MathMax = from.MathMax; |
+ MathMin = from.MathMin; |
+}); |
+ |
// ------------------------------------------------------------------- |
function ArrayBufferConstructor(length) { // length = 1 |
@@ -44,16 +56,16 @@ function ArrayBufferSlice(start, end) { |
var first; |
var byte_length = %_ArrayBufferGetByteLength(this); |
if (relativeStart < 0) { |
- first = $max(byte_length + relativeStart, 0); |
+ first = MathMax(byte_length + relativeStart, 0); |
} else { |
- first = $min(relativeStart, byte_length); |
+ first = MathMin(relativeStart, byte_length); |
} |
var relativeEnd = IS_UNDEFINED(end) ? byte_length : end; |
var fin; |
if (relativeEnd < 0) { |
- fin = $max(byte_length + relativeEnd, 0); |
+ fin = MathMax(byte_length + relativeEnd, 0); |
} else { |
- fin = $min(relativeEnd, byte_length); |
+ fin = MathMin(relativeEnd, byte_length); |
} |
if (fin < first) { |