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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 15 13:44:39 PST 2011


Darin Adler <darin at apple.com> has granted 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 115232: Patch
https://bugs.webkit.org/attachment.cgi?id=115232&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=115232&action=review


Looks OK. Needs a couple small changes.

> Source/JavaScriptCore/runtime/RegExpObject.cpp:124
> +    bool previousIsBackSlash = false;

backslash is one word, not two, so this should be named
previousCharacterWasBackslash

> Source/JavaScriptCore/runtime/RegExpObject.cpp:145
> +	   if (ch == '\n' || ch == '\r' || (ch & ~1) == 0x2028) {

This should use the inline isLineTerminator function instead of repeating its
code.

> Source/JavaScriptCore/runtime/RegExpObject.cpp:157
> +    if (!shouldEscape)
> +	 return jsString(exec, pattern);

This is indented wrong. Should be indented four spaces.

> Source/JavaScriptCore/runtime/RegExpObject.cpp:177
> +	   if (ch == '\n' || ch == '\r' || (ch & ~1) == 0x2028) {

This should use the inline isLineTerminator function instead of repeating its
code.


More information about the webkit-reviews mailing list