Generator declaration is not allowed in single statement position (#4815)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka robert.sipka@h-lab.eu
This commit is contained in:
Robert Sipka
2021-11-09 08:38:09 +01:00
committed by GitHub
parent 80777799f6
commit 4592143400
5 changed files with 39 additions and 6 deletions
+4
View File
@@ -1243,6 +1243,10 @@ parser_error_to_string (parser_error_t error) /**< error code */
{
return "Lexical declaration cannot appear in a single-statement context";
}
case PARSER_ERR_GENERATOR_IN_SINGLE_STATEMENT_POS:
{
return "Generator function cannot appear in a single-statement context";
}
case PARSER_ERR_LABELLED_FUNC_NOT_IN_BLOCK:
{
return "Labelled functions are only allowed inside blocks";