Describe the bug
If a string is composed only of a Unicode escape sequence (e.g. "\uABCD"), then an error occurs instead of producing a string.
To Reproduce
"\u00A7"
(that's the code for the section sign. It's not important, as the bug applies to any escape sequence)
Expected behavior
The string is valid, and is not supposed to throw an error. The syntax for string literals can be found here.
Build environment (please complete the following information):
Windows 10Version 1909 (OS Build 18363.1082)x86_64-pc-windows-msvcrustc 1.46.0 (04488afe3 2020-08-24)Additional context
Spec: https://tc39.es/ecma262/#sec-literals-string-literals
MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
As far as I can tell, the bug is caused by an issue in syntax/lexer/string.rs where once a Unicode escape sequence is detected, it skips checking for " and believes the string has finished without a ".
Hi @Razican , I would like to work on this issue. Could you please assign it to me? Thanks!
Most helpful comment
Hi @Razican , I would like to work on this issue. Could you please assign it to me? Thanks!