SVN commit 1106363 by orlovich: Apply patch from pcc (username peter, host pcc.me, tld uk) that fixes updating of lastIndex in Regexp.prototype.test. Thanks! M +7 -4 regexp_object.cpp --- trunk/KDE/kdelibs/kjs/regexp_object.cpp #1106362:1106363 @@ -113,18 +113,21 @@ bool didMatch = !match.isNull(); + if (globalFlag) { + if (didMatch) + thisObj->put(exec, exec->propertyNames().lastIndex, jsNumber(foundIndex + match.size()), DontDelete | DontEnum); + else + thisObj->put(exec, exec->propertyNames().lastIndex, jsNumber(0), DontDelete | DontEnum); + } + // Test if (id == Test) return jsBoolean(didMatch); // Exec if (didMatch) { - if (globalFlag) - thisObj->put(exec, exec->propertyNames().lastIndex, jsNumber(foundIndex + match.size()), DontDelete | DontEnum); return regExpObj->arrayOfMatches(exec, match); } else { - if (globalFlag) - thisObj->put(exec, exec->propertyNames().lastIndex, jsNumber(0), DontDelete | DontEnum); return jsNull(); } }