Methods shouldn't have prototype property (#3964)

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
This commit is contained in:
Csaba Osztrogonác
2020-08-05 14:01:58 +02:00
committed by GitHub
parent b82bd76175
commit c76736eadf
8 changed files with 22 additions and 15 deletions
@@ -1324,6 +1324,11 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
message_p = ECMA_ERR_MSG ("Async arrow functions cannot be invoked with 'new'.");
break;
}
case CBC_FUNCTION_METHOD:
{
message_p = ECMA_ERR_MSG ("Methods cannot be invoked with 'new'.");
break;
}
default:
{
JERRY_ASSERT (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_ACCESSOR);