Source/JavaScriptCore: Build fix attempt after r89885.
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2011 05:55:45 +0000 (05:55 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jun 2011 05:55:45 +0000 (05:55 +0000)
commit7aabbe6caea94d87603ed8775c9d6a8c9b4a6c1a
tree2906798cdbb8825864602b7430105da0bbf1f58f
parentcf26b9fe9dc73c1ef09f356593f2a1a4067a1c27
Source/JavaScriptCore: Build fix attempt after r89885.

Patch by Ryosuke Niwa <rniwa@webkit.org> on 2011-06-27
* JavaScriptCore.exp:
* jsc.cpp:

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=50554
RegExp.prototype.toString does not escape slashes

Reviewed by Darin Adler & Oliver Hunt.

The problem here is that we don't escape forwards slashes when converting
a RegExp to a string. This means that RegExp("/").toString() is "///",
which is not a valid RegExp literal. Also, we return an invalid literal
for RegExp.prototype.toString() ("//", which is an empty single-line comment).

From ES5:
"NOTE: The returned String has the form of a RegularExpressionLiteral that
evaluates to another RegExp object with the same behaviour as this object."

Added test cases.

* fast/regex/script-tests/toString.js: Added.
(testFwdSlash):
* fast/regex/toString-expected.txt: Added.
* fast/regex/toString.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/regex/script-tests/toString.js [new file with mode: 0644]
LayoutTests/fast/regex/toString-expected.txt [new file with mode: 0644]
LayoutTests/fast/regex/toString.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.cpp