Index: src/js/typedarray.js |
diff --git a/src/js/typedarray.js b/src/js/typedarray.js |
index 3f94122d76bd96f4e3cf00e337c9a369d6d2aa1f..a3dfde3499b4e51b639d9927e3ced7bb81f18e9f 100644 |
--- a/src/js/typedarray.js |
+++ b/src/js/typedarray.js |
@@ -617,7 +617,7 @@ |
var length = %_TypedArrayGetLength(this); |
return InnerArrayLastIndexOf(this, element, index, length, |
- arguments.length); |
+ %_ArgumentsLength()); |
} |
%FunctionSetLength(TypedArrayLastIndexOf, 1); |
@@ -681,7 +681,7 @@ |
var length = %_TypedArrayGetLength(this); |
return InnerArrayReduce(callback, current, this, length, |
- arguments.length); |
+ %_ArgumentsLength()); |
} |
%FunctionSetLength(TypedArrayReduce, 1); |
@@ -692,7 +692,7 @@ |
var length = %_TypedArrayGetLength(this); |
return InnerArrayReduceRight(callback, current, this, length, |
- arguments.length); |
+ %_ArgumentsLength()); |
} |
%FunctionSetLength(TypedArrayReduceRight, 1); |
@@ -753,10 +753,10 @@ |
// ES6 draft 08-24-14, section 22.2.2.2 |
function TypedArrayOf() { |
- var length = arguments.length; |
+ var length = %_ArgumentsLength(); |
var array = TypedArrayCreate(this, length); |
for (var i = 0; i < length; i++) { |
- array[i] = arguments[i]; |
+ array[i] = %_Arguments(i); |
} |
return array; |
} |
@@ -920,10 +920,9 @@ |
throw MakeTypeError(kIncompatibleMethodReceiver, |
'DataView.getTYPENAME', this); |
} |
- if (arguments.length < 1) throw MakeTypeError(kInvalidArgument); |
+ if (%_ArgumentsLength() < 1) throw MakeTypeError(kInvalidArgument); |
offset = ToPositiveInteger(offset, kInvalidDataViewAccessorOffset); |
- little_endian = TO_BOOLEAN(little_endian); |
- return %DataViewGetTYPENAME(this, offset, little_endian); |
+ return %DataViewGetTYPENAME(this, offset, !!little_endian); |
} |
%FunctionSetLength(DataViewGetTYPENAMEJS, 1); |
@@ -932,10 +931,9 @@ |
throw MakeTypeError(kIncompatibleMethodReceiver, |
'DataView.setTYPENAME', this); |
} |
- if (arguments.length < 2) throw MakeTypeError(kInvalidArgument); |
+ if (%_ArgumentsLength() < 2) throw MakeTypeError(kInvalidArgument); |
offset = ToPositiveInteger(offset, kInvalidDataViewAccessorOffset); |
- little_endian = TO_BOOLEAN(little_endian); |
- %DataViewSetTYPENAME(this, offset, TO_NUMBER(value), little_endian); |
+ %DataViewSetTYPENAME(this, offset, TO_NUMBER(value), !!little_endian); |
} |
%FunctionSetLength(DataViewSetTYPENAMEJS, 2); |
endmacro |