From 37d61fef02c5ac82edd60f1f7544cde6dab53ae6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 22 Jan 2013 11:53:08 +0100 Subject: [PATCH] Fix a bug in Array.proto.indexOf for sparse arrays Change-Id: I113c242b057ee4c6f2d06edf17e8bf8b453ba58c Reviewed-by: Simon Hausmann --- qv4array.cpp | 2 +- tests/TestExpectations | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/qv4array.cpp b/qv4array.cpp index 049402c..8cf745e 100644 --- a/qv4array.cpp +++ b/qv4array.cpp @@ -491,7 +491,7 @@ Value Array::indexOf(Value v, uint fromIndex, uint endIndex, ExecutionContext *c return Value::fromDouble(i); } } else if (sparse) { - for (SparseArrayNode *n = sparse->findNode(fromIndex); n && n->key() < endIndex; n = n->nextNode()) { + for (SparseArrayNode *n = sparse->lowerBound(fromIndex); n && n->key() < endIndex; n = n->nextNode()) { bool exists; Value value = o->getValueChecked(ctx, descriptor(n->value), &exists); if (exists && __qmljs_strict_equal(value, v)) diff --git a/tests/TestExpectations b/tests/TestExpectations index 4694aa2..ca67cd9 100644 --- a/tests/TestExpectations +++ b/tests/TestExpectations @@ -13,7 +13,6 @@ S15.9.3.1_A5_T6 failing # Tests failing that are supposed to pass. -15.4.4.14-9-9 failing S10.2.3_A1.1_T2 failing S10.2.3_A1.2_T2 failing S10.2.3_A1.3_T2 failing -- 2.7.4