jerryscript-project / jerryscript

Ultra-lightweight JavaScript engine for the Internet of Things.
https://jerryscript.net
Apache License 2.0
6.87k stars 666 forks source link

Raise syntax error on invalid unicode escape sequences #5146

Open matetokodi opened 1 week ago

matetokodi commented 1 week ago

Raise syntax error on invalid unicode escape sequences instead of failing with an assertion

The parser context was required for raising the error, which had to be added to all functions that can call lexer_unchecked_hex_to_character.

This fixes https://github.com/jerryscript-project/jerryscript/issues/5134

zherczeg commented 1 week ago

This patch adds a lot of extra operations. I am thinking why this was not needed before, how we handled this in other cases.