Correctly report error in for-in start in case of proxies (#4165)
In case of Proxies the "ownKeys" call can return an incompatible value for a for-in statement. In such cases the error should be propagated to the user. Fixes: #4159 JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
@@ -3737,6 +3737,14 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
|
||||
if (prop_names_p == NULL)
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (JERRY_UNLIKELY (ECMA_IS_VALUE_ERROR (expr_obj_value)))
|
||||
{
|
||||
result = expr_obj_value;
|
||||
goto error;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
/* The collection is already released */
|
||||
byte_code_p = byte_code_start_p + branch_offset;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user