comparison src/userfunc.c @ 25400:5c7192180b89 v8.2.3237

patch 8.2.3237: when a builtin function gives an error processing continues Commit: https://github.com/vim/vim/commit/327d3ee4557027b51aad86e68743a85ed3a6f52b Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 28 19:34:14 2021 +0200 patch 8.2.3237: when a builtin function gives an error processing continues Problem: When a builtin function gives an error processing continues. Solution: In Vim9 script return FAIL in get_func_tv().
author Bram Moolenaar <Bram@vim.org>
date Wed, 28 Jul 2021 19:45:04 +0200
parents 8ecd3575bc8c
children e3f1086429d8
comparison
equal deleted inserted replaced
25399:8c4523f3e3b4 25400:5c7192180b89
1672 else 1672 else
1673 ret = FAIL; 1673 ret = FAIL;
1674 1674
1675 if (ret == OK) 1675 if (ret == OK)
1676 { 1676 {
1677 int i = 0; 1677 int i = 0;
1678 int did_emsg_before = did_emsg;
1678 1679
1679 if (get_vim_var_nr(VV_TESTING)) 1680 if (get_vim_var_nr(VV_TESTING))
1680 { 1681 {
1681 // Prepare for calling test_garbagecollect_now(), need to know 1682 // Prepare for calling test_garbagecollect_now(), need to know
1682 // what variables are used on the call stack. 1683 // what variables are used on the call stack.
1687 ((typval_T **)funcargs.ga_data)[funcargs.ga_len++] = 1688 ((typval_T **)funcargs.ga_data)[funcargs.ga_len++] =
1688 &argvars[i]; 1689 &argvars[i];
1689 } 1690 }
1690 1691
1691 ret = call_func(name, len, rettv, argcount, argvars, funcexe); 1692 ret = call_func(name, len, rettv, argcount, argvars, funcexe);
1693 if (in_vim9script() && did_emsg > did_emsg_before)
1694 // An error in a builtin function does not return FAIL, but we do
1695 // want to abort further processing if an error was given.
1696 ret = FAIL;
1692 1697
1693 funcargs.ga_len -= i; 1698 funcargs.ga_len -= i;
1694 } 1699 }
1695 else if (!aborting()) 1700 else if (!aborting())
1696 { 1701 {