Version
16.8.0
Platform
No response
Subsystem
repl
What steps will reproduce the bug?
$ node
Welcome to Node.js v16.8.0.
Type ".help" for more information.
> await 'πππ' // or
> await 'πππ'; // or
> await 'πππ';;
How often does it reproduce? Is there a required condition?
All the time, as long as there is a top level await with one or more surrogate chars with a semicolon, or at least 3 surrogate chars.
What is the expected behavior?
> await 'πππ'
'πππ'
What do you see instead?
> await 'πππ'
}))()
^
Uncaught SyntaxError: Unexpected token '}'
> await 'πππ';
(async () => { return (await 'πππ';
^
Uncaught SyntaxError: Unexpected token ';'
> await 'πππ';;
undefined
Additional information
This is obviously reproducible with a more complex expression (for example await new buffer.Blob(['aaa', Buffer.from('èèeeπππaaa')]).text().
Version
16.8.0
Platform
No response
Subsystem
repl
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
All the time, as long as there is a top level await with one or more surrogate chars with a semicolon, or at least 3 surrogate chars.
What is the expected behavior?
What do you see instead?
Additional information
This is obviously reproducible with a more complex expression (for example
await new buffer.Blob(['aaa', Buffer.from('èèeeπππaaa')]).text().