2006-11-20 W. Andy Carrel <wac@google.com>
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Nov 2006 20:24:22 +0000 (20:24 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Nov 2006 20:24:22 +0000 (20:24 +0000)
commitd9d89fc14f4029bc6e5696fd5fab8f5e8e5d7da5
tree2d95f610d5e548e185ab2c0f3fb687dd107e69dd
parent2d0694cb9c7307b861018a98f7020f88f665b61c
2006-11-20  W. Andy Carrel  <wac@google.com>

        Reviewed by Maciej.

        http://bugs.webkit.org/show_bug.cgi?id=11501
        REGRESSION: \u no longer escapes metacharacters in RegExps
        http://bugs.webkit.org/show_bug.cgi?id=11502
        Serializing RegExps doesn't preserve Unicode escapes

JavaScriptCore:
        * kjs/lexer.cpp:
        (Lexer::Lexer):
        (Lexer::setCode):
        (Lexer::shift):
        (Lexer::scanRegExp):
        Push \u parsing back down into the RegExp object rather than in the
        parser. This backs out r17354 in favor of a new fix that better
        matches the behavior of other browsers.

        * kjs/lexer.h:
        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp):
        (KJS::sanitizePattern):
        (KJS::isHexDigit):
        (KJS::convertHex):
        (KJS::convertUnicode):
        * kjs/regexp.h:
        Translate \u escaped unicode characters for the benefit of pcre.

        * kjs/ustring.cpp:
        (KJS::UString::append):
        Fix failure to increment length on the first UChar appended to a
        UString that was copy-on-write.

        * tests/mozilla/ecma_2/RegExp/properties-001.js:
        Adjust tests back to the uniform standards.

LayoutTests:
        * fast/js/kde/RegExp-expected.txt:
        * fast/js/regexp-unicode-handling-expected.txt:
        Adjust these test results to passing as a result of other included
        changes in this revision.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/lexer.cpp
JavaScriptCore/kjs/lexer.h
JavaScriptCore/kjs/regexp.cpp
JavaScriptCore/kjs/regexp.h
JavaScriptCore/kjs/ustring.cpp
JavaScriptCore/tests/mozilla/ecma_2/RegExp/properties-001.js
LayoutTests/ChangeLog
LayoutTests/fast/js/kde/RegExp-expected.txt
LayoutTests/fast/js/regexp-unicode-handling-expected.txt