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

Unified Diff: src/js/typedarray.js

Issue 2744283002: [typedarrays] Implement %TypedArray%.prototype.lastIndexOf in C++ (Closed)
Patch Set: Correct integral value check Created 3 years, 9 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/array.js ('k') | test/mjsunit/es6/typedarray-indexing.js » ('j') | 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 c8e59e6c08da050320017e81a5fe24adeee6dfdd..c7288fc7480a7cd47b9ed2f27da8d34dba4aeef0 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -514,46 +514,6 @@ function TypedArraySort(comparefn) {
}
-// ES6 section 22.2.3.16
-function TypedArrayLastIndexOf(element, index) {
- if (!IS_TYPEDARRAY(this)) throw %make_type_error(kNotTypedArray);
-
- var length = %_TypedArrayGetLength(this);
-
- if (length === 0) return -1;
- if (!IS_NUMBER(element)) return -1;
- var n;
- if (arguments.length < 2) {
- n = length - 1;
- } else {
- n = TO_INTEGER(index);
- }
-
- var k;
- if (n >= 0) {
- if (length <= n) {
- k = length - 1;
- } else if (n === 0) {
- k = 0;
- } else {
- k = n;
- }
- } else {
- k = length + n;
- }
-
- while (k >= 0) {
- var elementK = this[k];
- if (element === elementK) {
- return k;
- }
- --k;
- }
- return -1;
-}
-%FunctionSetLength(TypedArrayLastIndexOf, 1);
-
-
// ES6 draft 07-15-13, section 22.2.3.18
function TypedArrayMap(f, thisArg) {
if (!IS_TYPEDARRAY(this)) throw %make_type_error(kNotTypedArray);
@@ -747,7 +707,6 @@ utils.InstallFunctions(GlobalTypedArray.prototype, DONT_ENUM, [
"find", TypedArrayFind,
"findIndex", TypedArrayFindIndex,
"join", TypedArrayJoin,
- "lastIndexOf", TypedArrayLastIndexOf,
"forEach", TypedArrayForEach,
"map", TypedArrayMap,
"reduce", TypedArrayReduce,
« no previous file with comments | « src/js/array.js ('k') | test/mjsunit/es6/typedarray-indexing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698