Skip to content
  • msaboff@apple.com's avatar
    Non-special escape character sequences cause JSC::Lexer::parseString to create 16 bit strings · 48f4353d
    msaboff@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=100576
    
    Reviewed by Darin Adler.
    
    Source/JavaScriptCore: 
    
    Changed singleEscape() processing to be based on a lookup of a static table.  The table
    covers ASCII characters SPACE through DEL.  If a character can be a single character escape,
    then the table provides the non-zero result of that escape.  Updated the result of
    singleEscape to be an LChar to make the table as small as possible.
    Added a new test fast/js/normal-character-escapes-in-string-literals.html to validated
    the behavior.
    
    * parser/Lexer.cpp:
    (JSC::singleEscape):
    (JSC::Lexer::parseString):
    (JSC::Lexer::parseStringSlowCase):
    
    LayoutTests: 
    
    Added a new test to validated the behavior of the corresponding changes to string processing
    in the Lexer.
    
    * fast/js/normal-character-escapes-in-string-literals-expected.txt: Added.
    * fast/js/normal-character-escapes-in-string-literals.html: Added.
    * fast/js/script-tests/normal-character-escapes-in-string-literals.js: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    48f4353d