Support strict mode detection in the pre-scanner. (#3450)

Furthermode an error is thrown when 'use strict' is used in a function with non-simple arguments
and function arguments are not moved to lexical environment when unmapped arguments are present.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-12-17 10:59:03 +01:00
committed by Robert Fancsik
parent b1237dbc5a
commit 3c0beaf87d
9 changed files with 305 additions and 138 deletions
+4
View File
@@ -937,6 +937,10 @@ parser_error_to_string (parser_error_t error) /**< error code */
return "Arguments is not allowed to be used here in strict mode.";
}
#if ENABLED (JERRY_ES2015)
case PARSER_ERR_USE_STRICT_NOT_ALLOWED:
{
return "The 'use strict' directive is not allowed for functions with non-simple arguments.";
}
case PARSER_ERR_YIELD_NOT_ALLOWED:
{
return "Incorrect use of yield keyword.";