Remove now-redundant special case from Array#lastIndexOf.

After the recent bugfix, the special case for 'undefined' is no longer
needed.

Bug: v8:7813
Change-Id: Iee3fccd72c525ac86a6fa6b3c55bcd2ce8159852
Reviewed-on: https://chromium-review.googlesource.com/1161906
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54897}
This commit is contained in:
Georg Neis 2018-08-03 11:07:58 +02:00 committed by Commit Bot
parent 8c6a91b5e9
commit 2b77c68bca

View File

@ -853,16 +853,8 @@ DEFINE_METHOD_LEN(
}
}
// Lookup through the array.
if (!IS_UNDEFINED(element)) {
for (var i = max; i >= min; i--) {
if (i in array && array[i] === element) return i;
}
return -1;
}
for (var i = max; i >= min; i--) {
if (i in array && IS_UNDEFINED(array[i])) {
return i;
}
if (i in array && array[i] === element) return i;
}
return -1;
},