From 1ca752482d7c61204d86abde9c85e805404237d1 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Mon, 19 Jun 2017 11:24:11 -0700 Subject: [PATCH] Add test that noctal escapes are forbidden in strings in strict code --- ...legacy-non-octal-escape-sequence-strict.js | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/language/literals/string/legacy-non-octal-escape-sequence-strict.js diff --git a/test/language/literals/string/legacy-non-octal-escape-sequence-strict.js b/test/language/literals/string/legacy-non-octal-escape-sequence-strict.js new file mode 100644 index 0000000000..69ee5e596d --- /dev/null +++ b/test/language/literals/string/legacy-non-octal-escape-sequence-strict.js @@ -0,0 +1,36 @@ +// Copyright (C) 2017 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-additional-syntax-string-literals +es6id: B1.2 +description: > + LegacyOctalEscapeSequence is not enabled in strict mode code (regardless of + the presence of Annex B) +info: > + EscapeSequence :: + CharacterEscapeSequence + LegacyOctalEscapeSequence + HexEscapeSequence + UnicodeEscapeSequence + + LegacyOctalEscapeSequence :: + OctalDigit [lookahead ∉ OctalDigit] + ZeroToThree OctalDigit [lookahead ∉ OctalDigit] + FourToSeven OctalDigit + ZeroToThree OctalDigit OctalDigit + + ZeroToThree :: one of + 0 1 2 3 + + FourToSeven :: one of + 4 5 6 7 + + This definition of EscapeSequence is not used in strict mode or when + parsing TemplateCharacter. +flags: [onlyStrict] +negative: + phase: early + type: SyntaxError +---*/ + +'\08';