[webkit-reviews] review denied: [Bug 71572] String new RegExp('\n').toString() returns is invalid RegularExpressionLiteral : [Attachment 113682] Patch

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


Gavin Barraclough <barraclough at apple.com> has denied Yusuke Suzuki
<utatane.tea at gmail.com>'s request for review:
Bug 71572: String new RegExp('\n').toString() returns is invalid
RegularExpressionLiteral
https://bugs.webkit.org/show_bug.cgi?id=71572

Attachment 113682: Patch
https://bugs.webkit.org/attachment.cgi?id=113682&action=review

------- Additional Comments from Gavin Barraclough <barraclough at apple.com>
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. :-)


More information about the webkit-reviews mailing list