Commit 2b77c68b authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

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/1161906Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54897}
parent 8c6a91b5
......@@ -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;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment