[Webkit-unassigned] [Bug 71572] String new RegExp('\n').toString() returns is invalid RegularExpressionLiteral

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 13 14:09:36 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=71572


Gavin Barraclough <barraclough at apple.com> changed:

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




--- Comment #3 from Gavin Barraclough <barraclough at apple.com>  2011-11-13 14:09:36 PST ---
(From update of attachment 113682)
Good catch & nice fix. But I think we may want to make one tweak to this patch before landing.  Most regular expressions don't contain forwards slashes or newlines, but this patch will always produce a fresh copy of the string every time source is called. Currently the code has an early return for strings that don't contain a forwards slash. We could expand this to also check for newline characters, and early return if the string contains neither forward slashes or newlines. r- for the loss of this optimization, but r+ in principle, we should definitely take this fix & the code looks great otherwise. :-)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list