SVN commit 1106364 by orlovich: Merged revision:r1106363 | orlovich | 2010-03-22 12:19:21 -0400 (Mon, 22 Mar 2010) | 6 lines 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 --- branches/KDE/4.4/kdelibs/kjs/regexp_object.cpp #1106363:1106364 @@ -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(); } }