Add validation for single statement lexical declarations (#3326)
This patch fixes #3275 and fixes #3276. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -1089,6 +1089,10 @@ parser_error_to_string (parser_error_t error) /**< error code */
|
||||
{
|
||||
return "Local variable is redeclared.";
|
||||
}
|
||||
case PARSER_ERR_LEXICAL_SINGLE_STATEMENT:
|
||||
{
|
||||
return "Lexical declaration cannot appear in a single-statement context.";
|
||||
}
|
||||
case PARSER_ERR_MISSING_ASSIGN_AFTER_CONST:
|
||||
{
|
||||
return "Value assignment is expected after a const declaration.";
|
||||
|
||||
Reference in New Issue
Block a user