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

List:       kde-commits
Subject:    KDE/kdelibs/kjs
From:       Maks Orlovich <maksim () kde ! org>
Date:       2010-03-22 16:19:21
Message-ID: 20100322161921.A20E3AC86C () svn ! kde ! org
[Download RAW message or body]

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


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

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