Rework external function handlers (#4599)

Instead of a fixed number of arguments, a call info structure is passed
to the handlers, which can be extended in the future without breaknig the
API. This structure holds new.target value, so its getter function is removed.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-02-17 17:52:19 +01:00
committed by GitHub
parent 488a0bf7e8
commit 112ad83aaa
51 changed files with 322 additions and 586 deletions
-28
View File
@@ -4835,34 +4835,6 @@ jerry_get_resource_name (const jerry_value_t value) /**< jerry api value */
return ecma_make_magic_string_value (LIT_MAGIC_STRING_RESOURCE_ANON);
} /* jerry_get_resource_name */
/**
* Access the "new.target" value.
*
* The "new.target" value depends on the current call site. That is
* this method will only have a function object result if, at the call site
* it was called inside a constructor method invoked with "new".
*
* @return "undefined" - if at the call site it was not a constructor call.
* function object - if the current call site is in a constructor call.
*/
jerry_value_t
jerry_get_new_target (void)
{
#if JERRY_ESNEXT
ecma_object_t *current_new_target_p = JERRY_CONTEXT (current_new_target_p);
if (current_new_target_p == NULL)
{
return jerry_create_undefined ();
}
ecma_ref_object (current_new_target_p);
return ecma_make_object_value (current_new_target_p);
#else /* !JERRY_ESNEXT */
return jerry_create_undefined ();
#endif /* JERRY_ESNEXT */
} /* jerry_get_new_target */
/**
* Replaces the currently active realm with another realm.
*