From bf6191f090b326eb0776cd4e921ddb56c8daa8a9 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 13 Jan 2014 09:09:14 +0100 Subject: Add a SimpleArrayData class This makes the ArrayData class 'pure virtual'. SimpleArrayData now contains the implementation of simple arrays. This makes the separation between simple and sparse arrays a lot cleaner. It also allows us to move len and offset from the base class into the SimpleArrayClass. This fixes some bugs where we accessed len for sparse arrays leading to some buggy behavior. Added a virtual length() method to ArrayData to query the highes used index in the Array. Change-Id: Iab2ba2a48ebe5b7031759eeb4ebe02b4d86233f0 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4regexpobject.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/qml/jsruntime/qv4regexpobject.cpp') diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index 1b55c5a2f1..2d92f12199 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -349,7 +349,6 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx) int end = matchOffsets[i * 2 + 1]; v = (start != -1 && end != -1) ? ctx->engine->newString(s.mid(start, end - start))->asReturnedValue() : Encode::undefined(); array->arrayData->put(i, v); - array->arrayData->setLength(i + 1); } array->setArrayLengthUnchecked(len); -- cgit v1.2.3