[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.4/kdelibs/kjs
From:       Maks Orlovich <maksim () kde ! org>
Date:       2010-03-22 16:20:53
Message-ID: 20100322162053.3A0D0AC86C () svn ! kde ! org
[Download RAW message or body]

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();
     }
   }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic