From fb05c9a4df07852e24a2085a2724ac3553103982 Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Mon, 20 Jul 2020 13:25:59 -0700 Subject: [PATCH] Add tests for \8 in template/strict strings. (#2654) --- .../invalid-legacy-octal-escape-sequence-8.js | 17 +++++++++++++++++ ...gacy-non-octal-escape-sequence-8-strict.js | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 test/language/expressions/template-literal/invalid-legacy-octal-escape-sequence-8.js create mode 100644 test/language/literals/string/legacy-non-octal-escape-sequence-8-strict.js diff --git a/test/language/expressions/template-literal/invalid-legacy-octal-escape-sequence-8.js b/test/language/expressions/template-literal/invalid-legacy-octal-escape-sequence-8.js new file mode 100644 index 0000000000..a4119588a9 --- /dev/null +++ b/test/language/expressions/template-literal/invalid-legacy-octal-escape-sequence-8.js @@ -0,0 +1,17 @@ +// Copyright (C) 2020 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-template-literal-lexical-components +description: > + Invalid octal escape sequence (regardless of the presence of Annex B) +info: | + A conforming implementation must not use the extended definition of + EscapeSequence described in B.1.2 when parsing a TemplateCharacter. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +`\8`; diff --git a/test/language/literals/string/legacy-non-octal-escape-sequence-8-strict.js b/test/language/literals/string/legacy-non-octal-escape-sequence-8-strict.js new file mode 100644 index 0000000000..492f0e2480 --- /dev/null +++ b/test/language/literals/string/legacy-non-octal-escape-sequence-8-strict.js @@ -0,0 +1,19 @@ +// Copyright (C) 2020 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-literals-string-literals +description: > + LegacyOctalEscapeSequence is not enabled in strict mode code + (regardless of the presence of Annex B) +info: | + A conforming implementation, when processing strict mode code, must not extend the + syntax of EscapeSequence to include LegacyOctalEscapeSequence as described in B.1.2. +flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +'\8';