Reviewed by Darin.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 May 2008 16:34:17 +0000 (16:34 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 May 2008 16:34:17 +0000 (16:34 +0000)
commitdf7add011a114446ffb55a680035c39143b25214
tree797d130a7e3723acac4feee4c31ac571a7103d9d
parent9620d592237c1b88f6aae8706b32725ac4e93c97
    Reviewed by Darin.

        <rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.

        <https://bugs.webkit.org/show_bug.cgi?id=4931>
        Unicode format characters (Cf) should be removed from JavaScript source

        Of all Cf characters, we are only removing BOM, because this is what Firefox trunk has
        settled upon, after extensive discussion and investigation.

        Based on Darin's work on this bug.

        Test: fast/js/removing-Cf-characters.html

        * kjs/lexer.cpp:
        (KJS::Lexer::setCode): Tweak formatting. Use a call to shift(4) to read in the
        first characters, instead of having special case code here.
        (KJS::Lexer::shift): Add a loop when reading a character to skip BOM characters.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/lexer.cpp
LayoutTests/ChangeLog
LayoutTests/fast/js/removing-Cf-characters-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/removing-Cf-characters.html [new file with mode: 0644]
LayoutTests/fast/js/resources/removing-Cf-characters.js [new file with mode: 0644]