| Index: src/typedarray.js
|
| diff --git a/src/typedarray.js b/src/typedarray.js
|
| index baf8edb99128af2a1b7a26f07107d91fd8f59daf..28d073aa2e0ab7488396fa6f65bc686f7d7c91e2 100644
|
| --- a/src/typedarray.js
|
| +++ b/src/typedarray.js
|
| @@ -2,17 +2,31 @@
|
| // 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 GlobalArray = global.Array;
|
| var GlobalArrayBuffer = global.ArrayBuffer;
|
| var GlobalDataView = global.DataView;
|
| var GlobalObject = global.Object;
|
|
|
| +var MathMax;
|
| +var MathMin;
|
| +
|
| +utils.Import(function(from) {
|
| + MathMax = from.MathMax;
|
| + MathMin = from.MathMin;
|
| +});
|
| +
|
| +// -------------------------------------------------------------------
|
| +
|
| +
|
| macro TYPED_ARRAYS(FUNCTION)
|
| // arrayIds below should be synchronized with Runtime_TypedArrayInitialize.
|
| FUNCTION(1, Uint8Array, 1)
|
| @@ -165,16 +179,16 @@ function NAMESubArray(begin, end) {
|
|
|
| var srcLength = %_TypedArrayGetLength(this);
|
| if (beginInt < 0) {
|
| - beginInt = $max(0, srcLength + beginInt);
|
| + beginInt = MathMax(0, srcLength + beginInt);
|
| } else {
|
| - beginInt = $min(srcLength, beginInt);
|
| + beginInt = MathMin(srcLength, beginInt);
|
| }
|
|
|
| var endInt = IS_UNDEFINED(end) ? srcLength : end;
|
| if (endInt < 0) {
|
| - endInt = $max(0, srcLength + endInt);
|
| + endInt = MathMax(0, srcLength + endInt);
|
| } else {
|
| - endInt = $min(endInt, srcLength);
|
| + endInt = MathMin(endInt, srcLength);
|
| }
|
| if (endInt < beginInt) {
|
| endInt = beginInt;
|
|
|