Skip to content
  • barraclough@apple.com's avatar
    Source/JavaScriptCore: Build fix attempt after r89885. · 4a5c87a6
    barraclough@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@89895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4a5c87a6