Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Unified Diff: src/js/typedarray.js

Issue 1677063005: Revert of [builtins] Remove bunch of uses of %_Arguments and %_ArgumentsLength. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/spread.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/js/spread.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698