From d279980b96efe7aa5ac0af23716ecd3a5da13cad Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Mon, 30 Mar 2020 08:16:41 +0300 Subject: [PATCH] Add single quote string literal test --- .../unicode-escape-no-hex-err-single.js | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test/language/literals/string/unicode-escape-no-hex-err-single.js diff --git a/test/language/literals/string/unicode-escape-no-hex-err-single.js b/test/language/literals/string/unicode-escape-no-hex-err-single.js new file mode 100644 index 0000000000..d34e4bacad --- /dev/null +++ b/test/language/literals/string/unicode-escape-no-hex-err-single.js @@ -0,0 +1,46 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-StringLiteral +description: > + \u is at the end of string, Hex4Digits is required. +info: | + StringLiteral :: + " DoubleStringCharacters_opt " + ' SingleStringCharacters_opt ' + + SingleStringCharacters :: + SingleStringCharacter SingleStringCharacters_opt + + SingleStringCharacter :: + SourceCharacter but not one of ' or \ or LineTerminator + + + \ EscapeSequence + LineContinuation + + EscapeSequence :: + CharacterEscapeSequence + 0 [lookahead ∉ DecimalDigit] + HexEscapeSequence + UnicodeEscapeSequence + + UnicodeEscapeSequence :: + u Hex4Digits + u{ CodePoint } + + Hex4Digits :: + HexDigit HexDigit HexDigit HexDigit + + HexDigit :: one of + 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F + +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +'\u'