Rework function call. (#2414)
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -204,6 +204,22 @@ ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on
|
||||
return JERRY_CONTEXT (ecma_builtin_objects)[builtin_id];
|
||||
} /* ecma_builtin_get */
|
||||
|
||||
/**
|
||||
* Get reference to the global object
|
||||
*
|
||||
* Note:
|
||||
* Does not increase the reference counter.
|
||||
*
|
||||
* @return pointer to the global object
|
||||
*/
|
||||
inline ecma_object_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_builtin_get_global (void)
|
||||
{
|
||||
JERRY_ASSERT (JERRY_CONTEXT (ecma_builtin_objects)[ECMA_BUILTIN_ID_GLOBAL] != NULL);
|
||||
|
||||
return JERRY_CONTEXT (ecma_builtin_objects)[ECMA_BUILTIN_ID_GLOBAL];
|
||||
} /* ecma_builtin_get_global */
|
||||
|
||||
/**
|
||||
* Checks whether the given function is a built-in routine
|
||||
*
|
||||
|
||||
@@ -96,6 +96,8 @@ bool
|
||||
ecma_builtin_is (ecma_object_t *obj_p, ecma_builtin_id_t builtin_id);
|
||||
ecma_object_t *
|
||||
ecma_builtin_get (ecma_builtin_id_t builtin_id);
|
||||
ecma_object_t *
|
||||
ecma_builtin_get_global (void);
|
||||
bool
|
||||
ecma_builtin_function_is_routine (ecma_object_t *func_obj_p);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user