[Webkit-unassigned] [Bug 9234] Implement $&, $' and $` replacement codes in String.prototype.replace

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Fri Jun 2 11:28:57 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9234


ggaren at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #8665|review?                     |
               Flag|                            |




------- Comment #2 from ggaren at apple.com  2006-06-02 11:28 PDT -------
(From update of attachment 8665)
for (int i = 0; (i = substitutedReplacement.find(UString("$"), i)) != -1; i++)
{

This line confused the dickens out of me, because 'i = 0' has no meaning, and
'i++' has meaning only as a side-effect in the test that follows it. I know
it's not something you changed, but consider one of these (maybe my perception
is skewed):

int i = -1;
while ((i = substitutedReplacement.find(UString("$"), i + 1)) != -1)

OR

for (int i = substitutedReplacement.find(UString("$")); i != -1; i =
substitutedReplacement.find(UString("$"), i + 1))

This comment would change, too:
      i += backrefLength - 1; // -1 offsets i++ (--> 'i + 1')


Anyway, looks good. We discussed how to write a layout test, so I'm going to
clear the review bit for now.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list