Index: src/arraybuffer.js |
diff --git a/src/arraybuffer.js b/src/arraybuffer.js |
index 6125f0f61cb3eb1a258573106a5f4bb2daa7ee17..cfaa8d7efca4689b9b715cd3fb34212d6e35346e 100644 |
--- a/src/arraybuffer.js |
+++ b/src/arraybuffer.js |
@@ -57,17 +57,18 @@ function ArrayBufferSlice(start, end) { |
var relativeStart = TO_INTEGER(start); |
var first; |
+ var byte_length = %ArrayBufferGetByteLength(this); |
if (relativeStart < 0) { |
- first = MathMax(this.byteLength + relativeStart, 0); |
+ first = MathMax(byte_length + relativeStart, 0); |
} else { |
- first = MathMin(relativeStart, this.byteLength); |
+ first = MathMin(relativeStart, byte_length); |
} |
- var relativeEnd = IS_UNDEFINED(end) ? this.byteLength : TO_INTEGER(end); |
+ var relativeEnd = IS_UNDEFINED(end) ? byte_length : TO_INTEGER(end); |
var fin; |
if (relativeEnd < 0) { |
- fin = MathMax(this.byteLength + relativeEnd, 0); |
+ fin = MathMax(byte_length + relativeEnd, 0); |
} else { |
- fin = MathMin(relativeEnd, this.byteLength); |
+ fin = MathMin(relativeEnd, byte_length); |
} |
if (fin < first) { |