[webkit-changes] cvs commit: JavaScriptCore/kjs regexp_object.cpp

Geoffrey ggaren at opensource.apple.com
Thu Nov 3 10:11:59 PST 2005


ggaren      05/11/03 10:11:58

  Modified:    .        ChangeLog
               kjs      regexp_object.cpp
  Log:
          Reviewed by darin.
  
          - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5602
            REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
  
          We now update lastIndex relative to the start of the last match,
          rather than the start of the last search. We used to assume that
          the two were equal, but that may not be the case in $ matches.
  
          * kjs/regexp_object.cpp:
          (RegExpProtoFuncImp::callAsFunction):
  
  Revision  Changes    Path
  1.871     +14 -0     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.870
  retrieving revision 1.871
  diff -u -r1.870 -r1.871
  --- ChangeLog	24 Oct 2005 21:22:19 -0000	1.870
  +++ ChangeLog	3 Nov 2005 18:11:57 -0000	1.871
  @@ -1,3 +1,17 @@
  +2005-11-03  Geoffrey Garen  <ggaren at apple.com>
  +
  +        Reviewed by darin.
  +
  +        - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5602
  +          REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
  +
  +        We now update lastIndex relative to the start of the last match,
  +        rather than the start of the last search. We used to assume that
  +        the two were equal, but that may not be the case in $ matches.
  +
  +        * kjs/regexp_object.cpp:
  +        (RegExpProtoFuncImp::callAsFunction):
  +
   2005-10-24  John Sullivan  <sullivan at apple.com>
   
           Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
  
  
  
  1.27      +3 -2      JavaScriptCore/kjs/regexp_object.cpp
  
  Index: regexp_object.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/regexp_object.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- regexp_object.cpp	11 Oct 2005 20:43:49 -0000	1.26
  +++ regexp_object.cpp	3 Nov 2005 18:11:58 -0000	1.27
  @@ -109,7 +109,8 @@
         return Null();
       }
   
  -    UString match = regExpObj->performMatch(regExp, input, static_cast<int>(lastIndex));
  +    int foundIndex;
  +    UString match = regExpObj->performMatch(regExp, input, static_cast<int>(lastIndex), &foundIndex);
       bool didMatch = !match.isNull();
   
       // Test
  @@ -119,7 +120,7 @@
       // Exec
       if (didMatch) {
         if (globalFlag)
  -        thisObj->put(exec, "lastIndex", Number(lastIndex + match.size()), DontDelete | DontEnum);
  +        thisObj->put(exec, "lastIndex", Number(foundIndex + match.size()), DontDelete | DontEnum);
         return regExpObj->arrayOfMatches(exec, match);
       } else {
         if (globalFlag)
  
  
  



More information about the webkit-changes mailing list