Index: src/js/array.js |
diff --git a/src/js/array.js b/src/js/array.js |
index 88e8cb3ea7dcfe6ab10e5514f777100d135f7980..0af620c48d4ec2633accf39f9807c1b11ebf880a 100644 |
--- a/src/js/array.js |
+++ b/src/js/array.js |
@@ -1134,9 +1134,14 @@ function ArrayMap(f, receiver) { |
} |
-function InnerArrayLastIndexOf(array, element, index, length, argumentsLength) { |
+function ArrayLastIndexOf(element, index) { |
+ CHECK_OBJECT_COERCIBLE(this, "Array.prototype.lastIndexOf"); |
+ |
+ var array = this; |
+ var length = TO_LENGTH(this.length); |
+ |
if (length == 0) return -1; |
- if (argumentsLength < 2) { |
+ if (arguments.length < 2) { |
index = length - 1; |
} else { |
index = INVERT_NEG_ZERO(TO_INTEGER(index)); |
@@ -1184,15 +1189,6 @@ function InnerArrayLastIndexOf(array, element, index, length, argumentsLength) { |
} |
-function ArrayLastIndexOf(element, index) { |
- CHECK_OBJECT_COERCIBLE(this, "Array.prototype.lastIndexOf"); |
- |
- var length = TO_LENGTH(this.length); |
- return InnerArrayLastIndexOf(this, element, index, length, |
- arguments.length); |
-} |
- |
- |
function InnerArrayReduce(callback, current, array, length, argumentsLength) { |
if (!IS_CALLABLE(callback)) { |
throw %make_type_error(kCalledNonCallable, callback); |
@@ -1628,7 +1624,6 @@ utils.Export(function(to) { |
to.InnerArrayFindIndex = InnerArrayFindIndex; |
to.InnerArrayForEach = InnerArrayForEach; |
to.InnerArrayJoin = InnerArrayJoin; |
- to.InnerArrayLastIndexOf = InnerArrayLastIndexOf; |
to.InnerArrayReduce = InnerArrayReduce; |
to.InnerArrayReduceRight = InnerArrayReduceRight; |
to.InnerArraySome = InnerArraySome; |