4545
4646static ecma_value_t
4747ecma_builtin_regexp_dispatch_helper (const ecma_value_t * arguments_list_p , /**< arguments list */
48- ecma_length_t arguments_list_len , /**< number of arguments */
49- ecma_object_t * new_target_p ) /**< pointer to the new target object */
48+ ecma_length_t arguments_list_len ) /**< number of arguments */
5049{
5150 ecma_value_t pattern_value = ECMA_VALUE_UNDEFINED ;
5251 ecma_value_t flags_value = ECMA_VALUE_UNDEFINED ;
5352#if ENABLED (JERRY_ES2015 )
5453 bool create_regexp_from_bc = false;
5554 bool free_arguments = false;
55+ ecma_object_t * new_target_p = JERRY_CONTEXT (current_new_target );
56+ #else /* !ENABLED (JERRY_ES2015) */
57+ ecma_object_t * new_target_p = NULL ;
5658#endif /* ENABLED (JERRY_ES2015) */
5759
5860 if (arguments_list_len > 0 )
@@ -206,8 +208,7 @@ ecma_builtin_regexp_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
206208 ecma_length_t arguments_list_len ) /**< number of arguments */
207209{
208210 return ecma_builtin_regexp_dispatch_helper (arguments_list_p ,
209- arguments_list_len ,
210- NULL );
211+ arguments_list_len );
211212} /* ecma_builtin_regexp_dispatch_call */
212213
213214/**
@@ -221,8 +222,7 @@ ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /*
221222 ecma_length_t arguments_list_len ) /**< number of arguments */
222223{
223224 return ecma_builtin_regexp_dispatch_helper (arguments_list_p ,
224- arguments_list_len ,
225- ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP ));
225+ arguments_list_len );
226226} /* ecma_builtin_regexp_dispatch_construct */
227227
228228#if ENABLED (JERRY_ES2015 )
0 commit comments