From 48b4aa66af6b593630d1330124c9c7a0ebccfe98 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 7 May 2018 16:58:42 -0400 Subject: [PATCH 1/3] Remove no-longer-valid tests --- test/language/line-terminators/S7.3_A2.3.js | 12 ------------ test/language/line-terminators/S7.3_A2.4.js | 13 ------------- 2 files changed, 25 deletions(-) delete mode 100644 test/language/line-terminators/S7.3_A2.3.js delete mode 100644 test/language/line-terminators/S7.3_A2.4.js diff --git a/test/language/line-terminators/S7.3_A2.3.js b/test/language/line-terminators/S7.3_A2.3.js deleted file mode 100644 index fb26e7e7a7..0000000000 --- a/test/language/line-terminators/S7.3_A2.3.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: LINE SEPARATOR (U+2028) within strings is not allowed -es5id: 7.3_A2.3 -description: Insert LINE SEPARATOR (\u2028) into string ----*/ - -assert.throws(SyntaxError, function() { - eval("'\u2028str\u2028ing\u2028'"); -}); diff --git a/test/language/line-terminators/S7.3_A2.4.js b/test/language/line-terminators/S7.3_A2.4.js deleted file mode 100644 index 582a84f642..0000000000 --- a/test/language/line-terminators/S7.3_A2.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: PARAGRAPH SEPARATOR (U+2029) within strings is not allowed -es5id: 7.3_A2.4 -description: Insert PARAGRAPH SEPARATOR (\u2029) into string ----*/ - -// CHECK#1 -assert.throws(SyntaxError, function() { - eval("'\u2029str\u2029ing\u2029'"); -}); From ba124c31b2e9ead135091449ac583993a36649f5 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 7 May 2018 16:59:55 -0400 Subject: [PATCH 2/3] Add tests for non-ASCII LineTerminator characters in string literals --- .../literals/string/line-separator-eval.js | 16 ++++++++++++++++ test/language/literals/string/line-separator.js | 17 +++++++++++++++++ .../literals/string/paragraph-separator-eval.js | 16 ++++++++++++++++ .../literals/string/paragraph-separator.js | 17 +++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 test/language/literals/string/line-separator-eval.js create mode 100644 test/language/literals/string/line-separator.js create mode 100644 test/language/literals/string/paragraph-separator-eval.js create mode 100644 test/language/literals/string/paragraph-separator.js diff --git a/test/language/literals/string/line-separator-eval.js b/test/language/literals/string/line-separator-eval.js new file mode 100644 index 0000000000..b9bd4932bd --- /dev/null +++ b/test/language/literals/string/line-separator-eval.js @@ -0,0 +1,16 @@ +// Copyright (C) 2018 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-literals-string-literals +description: > + U+2028 LINE SEPARATOR can appear in string literals (eval code). +info: | + 11.8.4 String Literals + + All code points may appear literally in a string literal except for the + closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), + and U+000A (LINE FEED). +---*/ + +assert.sameValue(eval("'\u2028'"), "\u2028"); diff --git a/test/language/literals/string/line-separator.js b/test/language/literals/string/line-separator.js new file mode 100644 index 0000000000..619d70051c --- /dev/null +++ b/test/language/literals/string/line-separator.js @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-literals-string-literals +description: > + U+2028 LINE SEPARATOR can appear in string literals. +info: | + 11.8.4 String Literals + + All code points may appear literally in a string literal except for the + closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), + and U+000A (LINE FEED). +---*/ + +// U+2028 in strings; UTF8(0x2028) = 0xE2 0x80 0xA8 +assert.sameValue("
", "\u2028"); diff --git a/test/language/literals/string/paragraph-separator-eval.js b/test/language/literals/string/paragraph-separator-eval.js new file mode 100644 index 0000000000..68840e7424 --- /dev/null +++ b/test/language/literals/string/paragraph-separator-eval.js @@ -0,0 +1,16 @@ +// Copyright (C) 2018 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-literals-string-literals +description: > + U+2029 PARAGRAPH SEPARATOR can appear in string literals (eval code). +info: | + 11.8.4 String Literals + + All code points may appear literally in a string literal except for the + closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), + and U+000A (LINE FEED). +---*/ + +assert.sameValue(eval("'\u2029'"), "\u2029"); diff --git a/test/language/literals/string/paragraph-separator.js b/test/language/literals/string/paragraph-separator.js new file mode 100644 index 0000000000..9c3bf0896f --- /dev/null +++ b/test/language/literals/string/paragraph-separator.js @@ -0,0 +1,17 @@ +// Copyright (C) 2018 Richard Gibson. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-literals-string-literals +description: > + U+2029 PARAGRAPH SEPARATOR can appear in string literals. +info: | + 11.8.4 String Literals + + All code points may appear literally in a string literal except for the + closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), + and U+000A (LINE FEED). +---*/ + +// U+2029 in strings; UTF8(0x2029) = 0xE2 0x80 0xA9 +assert.sameValue("
", "\u2029"); From dbc0c6b1cc630250680bf5fdece62d83971bd83e Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 8 May 2018 14:19:44 -0400 Subject: [PATCH 3/3] Add json-superset feature --- features.txt | 4 ++++ test/language/literals/string/line-separator-eval.js | 1 + test/language/literals/string/line-separator.js | 1 + test/language/literals/string/paragraph-separator-eval.js | 1 + test/language/literals/string/paragraph-separator.js | 1 + 5 files changed, 8 insertions(+) diff --git a/features.txt b/features.txt index 7b3c74a5fe..c1a145619e 100644 --- a/features.txt +++ b/features.txt @@ -77,6 +77,10 @@ numeric-separator-literal String.prototype.matchAll Symbol.matchAll +# ECMAScript ⊃ JSON +# https://github.com/tc39/proposal-json-superset +json-superset + # Intl.Locale # https://github.com/tc39/proposal-intl-locale Intl.Locale diff --git a/test/language/literals/string/line-separator-eval.js b/test/language/literals/string/line-separator-eval.js index b9bd4932bd..c8f4b33cbc 100644 --- a/test/language/literals/string/line-separator-eval.js +++ b/test/language/literals/string/line-separator-eval.js @@ -11,6 +11,7 @@ info: | All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). +features: [json-superset] ---*/ assert.sameValue(eval("'\u2028'"), "\u2028"); diff --git a/test/language/literals/string/line-separator.js b/test/language/literals/string/line-separator.js index 619d70051c..359b8977fc 100644 --- a/test/language/literals/string/line-separator.js +++ b/test/language/literals/string/line-separator.js @@ -11,6 +11,7 @@ info: | All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). +features: [json-superset] ---*/ // U+2028 in strings; UTF8(0x2028) = 0xE2 0x80 0xA8 diff --git a/test/language/literals/string/paragraph-separator-eval.js b/test/language/literals/string/paragraph-separator-eval.js index 68840e7424..18e8df3a3f 100644 --- a/test/language/literals/string/paragraph-separator-eval.js +++ b/test/language/literals/string/paragraph-separator-eval.js @@ -11,6 +11,7 @@ info: | All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). +features: [json-superset] ---*/ assert.sameValue(eval("'\u2029'"), "\u2029"); diff --git a/test/language/literals/string/paragraph-separator.js b/test/language/literals/string/paragraph-separator.js index 9c3bf0896f..5e0ab44760 100644 --- a/test/language/literals/string/paragraph-separator.js +++ b/test/language/literals/string/paragraph-separator.js @@ -11,6 +11,7 @@ info: | All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED). +features: [json-superset] ---*/ // U+2029 in strings; UTF8(0x2029) = 0xE2 0x80 0xA9