Implement JSON superset (#4099)

JSON strings can contain unescaped LINE SEPARATOR and PARAGRAPH SEPARATOR in ES11

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2020-08-04 16:56:08 +02:00
committed by GitHub
parent 621a5ddb8f
commit 019dd03fcc
5 changed files with 57 additions and 14 deletions
+16
View File
@@ -0,0 +1,16 @@
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
assert(eval("'\u2028'") === "\u2028");
assert(eval("'\u2029'") === "\u2029");
+27
View File
@@ -0,0 +1,27 @@
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
try {
eval("'\u2028'");
assert(false);
} catch (e) {
assert(e instanceof SyntaxError);
}
try {
eval("'\u2029'");
assert(false);
} catch (e) {
assert(e instanceof SyntaxError);
}
+2
View File
@@ -320,6 +320,8 @@
<test id="language/expressions/tagged-template/cache-identical-source.js"><reason></reason></test>
<test id="language/expressions/tagged-template/cache-identical-source-new-function.js"><reason></reason></test>
<test id="language/expressions/template-literal/invalid-legacy-octal-escape-sequence.js"><reason></reason></test>
<test id="language/line-terminators/S7.3_A2.3.js"><reason>No longer a SyntaxError in ES11</reason></test>
<test id="language/line-terminators/S7.3_A2.4.js"><reason>No longer a SyntaxError in ES11</reason></test>
<test id="language/literals/string/7.8.4-1-s.js"><reason></reason></test>
<test id="language/module-code/export-unresolvable.js"><reason></reason></test>
<test id="language/statements/class/definition/methods.js"><reason></reason></test>
-4
View File
@@ -6979,10 +6979,6 @@
<test id="language/literals/numeric/numeric-separators/numeric-separator-literal-sign-plus-dds-nsl-dd.js"><reason></reason></test>
<test id="language/literals/regexp/named-groups/forward-reference.js"><reason></reason></test>
<test id="language/literals/string/legacy-octal-escape-sequence-prologue-strict.js"><reason></reason></test>
<test id="language/literals/string/line-separator-eval.js"><reason></reason></test>
<test id="language/literals/string/line-separator.js"><reason></reason></test>
<test id="language/literals/string/paragraph-separator-eval.js"><reason></reason></test>
<test id="language/literals/string/paragraph-separator.js"><reason></reason></test>
<test id="language/module-code/early-export-global.js"><reason></reason></test>
<test id="language/module-code/early-export-unresolvable.js"><reason></reason></test>
<test id="language/module-code/early-strict-mode.js"><reason></reason></test>