JavaScript identifier incorrectly parsed if the prefix before an escape sequence...
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2015 18:48:58 +0000 (18:48 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jan 2015 18:48:58 +0000 (18:48 +0000)
commit752e216741ff05c2daf85c94e3d9a1b991c85444
tree7a3401c1560bf44202fdd9890c545993e2c6881e
parentdd7631698e208e988e65c026341967da3b1723d8
JavaScript identifier incorrectly parsed if the prefix before an escape sequence is a keyword
https://bugs.webkit.org/show_bug.cgi?id=140420

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

Added new function isIdentPartIncludingEscape() that performs the original
isIdentPart() followed by a check for a valid unicode escape.  If there is a
unicode escape, its resolved value is checked with isIdentPart().

* KeywordLookupGenerator.py:
(Trie.printSubTreeAsC):
(Trie.printAsC):
* parser/Lexer.cpp:
(JSC::isUnicodeEscapeIdentPart):
(JSC::isIdentPartIncludingEscape):

LayoutTests:

New regression test.

* js/regress-140420-expected.txt: Added.
* js/regress-140420.html: Added.
* js/script-tests/regress-140420.js: Added.
(with):
(this):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/regress-140420-expected.txt [new file with mode: 0644]
LayoutTests/js/regress-140420.html [new file with mode: 0644]
LayoutTests/js/script-tests/regress-140420.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/KeywordLookupGenerator.py
Source/JavaScriptCore/parser/Lexer.cpp