Remove "arguments" and "caller" from specific functions (#3918)

As stated in ES 16.1, "arguments" and "caller" must not be created in:
- strict functions created using the Function constructor
- generator functions created using the Generator constructor
- async functions created using the AsyncFunction constructor
- functions created using the bind

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
Rafal Walczyna
2020-06-22 19:08:13 +02:00
committed by GitHub
parent 281635cb40
commit e64fc9aca9
4 changed files with 80 additions and 7 deletions
+1
View File
@@ -3379,6 +3379,7 @@ lexer_string_is_directive (parser_context_t *context_p) /**< context */
{
return (context_p->token.type == LEXER_SEMICOLON
|| context_p->token.type == LEXER_RIGHT_BRACE
|| context_p->token.type == LEXER_EOS
|| ((context_p->token.flags & LEXER_WAS_NEWLINE)
&& !LEXER_IS_BINARY_OP_TOKEN (context_p->token.type)
&& context_p->token.type != LEXER_LEFT_PAREN