[JSC] Relax line terminators in String to make JSON subset of JS
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 07:34:44 +0000 (07:34 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 07:34:44 +0000 (07:34 +0000)
commitd40b2e1066d4373ea82a945293e796b24702cab1
treeb8a65a1c0f1ecfa3822aee833cb08f0d9b7622f1
parentbdc8d8ab16aaa33725fad67f02698f84adebab2d
[JSC] Relax line terminators in String to make JSON subset of JS
https://bugs.webkit.org/show_bug.cgi?id=182232

Reviewed by Keith Miller.

JSTests:

* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/relaxed-line-terminators-in-string.js: Added.
(shouldBe):

Source/JavaScriptCore:

"Subsume JSON" spec is now stage 3[1]. Before this spec change,
JSON can accept \u2028 / \u2029 in string while JS cannot do that.
It accidentally made JSON non subset of JS.

Now we extend our JS string to accept \u2028 / \u2029 to make JSON
subset of JS in this spec change.

[1]: https://github.com/tc39/proposal-json-superset

* parser/Lexer.cpp:
(JSC::Lexer<T>::parseStringSlowCase):

LayoutTests:

* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChakraCore/test/es5/Lex_u3.baseline-jsc
JSTests/ChangeLog
JSTests/stress/relaxed-line-terminators-in-string.js [new file with mode: 0644]
LayoutTests/ChangeLog
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3-expected.txt
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4-expected.txt
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Lexer.cpp