We incorrectly allow escaped characters in keyword tokens
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jun 2017 18:23:59 +0000 (18:23 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Jun 2017 18:23:59 +0000 (18:23 +0000)
commit2cf2c7c3a0b0c99e551e0f5761df5ff3b5c3f60d
tree09add980eef15fbf6f7b7a1000c30ad4acb5af67
parentba47d9e933f80076bc31991ba28ce8f70fc6543b
We incorrectly allow escaped characters in keyword tokens
https://bugs.webkit.org/show_bug.cgi?id=171310

Reviewed by Yusuke Suzuki.

JSTests:

* stress/destructuring-assignment-syntax.js:
* stress/error-messages-for-in-operator-should-not-crash.js:
(catch):
* stress/reserved-word-with-escape.js:
(testSyntaxError.String.raw.v):
(String.raw.SyntaxError.Cannot.use.the.keyword.string_appeared_here.as.a.name):
(testSyntaxError.String.raw.a):
* JSTests/ChakraCore/test/Basics/IdsWithEscapes.baseline-jsc:

Source/JavaScriptCore:

According spec it is not allow to use escaped characters in
keywords. https://tc39.github.io/ecma262/#sec-reserved-words
Current patch implements this requirements.

* parser/Lexer.cpp:
(JSC::Lexer<CharacterType>::parseIdentifierSlowCase):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::printUnexpectedTokenText):
* parser/ParserTokens.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@218111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChakraCore/test/Basics/IdsWithEscapes.baseline-jsc
JSTests/ChangeLog
JSTests/stress/destructuring-assignment-syntax.js
JSTests/stress/error-messages-for-in-operator-should-not-crash.js
JSTests/stress/reserved-word-with-escape.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Lexer.cpp
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/ParserTokens.h