…rees before exiting execution This patch fixes #4870. The implementation is based on PR #4966, only resolved the conflicts and applied requested changes. Co-authored-by: Martin Negyokru [email protected] JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi [email protected]