diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2022-09-02 15:15:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-02 15:15:27 +0100 |
commit | 8deb2b30c77035bb682ccf80b781455ac1d6038b (patch) | |
tree | 66a1d18ad9971c123f42bd7879c56706e19be73b /src/time.c | |
parent | 119167265ebc7eced210a7f8ed2f4b90378f98f1 (diff) |
patch 9.0.0359: error message for wrong argument type is not specificv9.0.0359
Problem: Error message for wrong argument type is not specific.
Solution: Include more information in the error. (Yegappan Lakshmanan,
closes #11037)
Diffstat (limited to 'src/time.c')
-rw-r--r-- | src/time.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/time.c b/src/time.c index d97c56e6c8..58337c9f65 100644 --- a/src/time.c +++ b/src/time.c @@ -805,19 +805,14 @@ f_timer_info(typval_T *argvars, typval_T *rettv) if (rettv_list_alloc(rettv) == FAIL) return; - if (in_vim9script() && check_for_opt_number_arg(argvars, 0) == FAIL) + if (check_for_opt_number_arg(argvars, 0) == FAIL) return; if (argvars[0].v_type != VAR_UNKNOWN) { - if (argvars[0].v_type != VAR_NUMBER) - emsg(_(e_number_expected)); - else - { - timer = find_timer((int)tv_get_number(&argvars[0])); - if (timer != NULL) - add_timer_info(rettv, timer); - } + timer = find_timer((int)tv_get_number(&argvars[0])); + if (timer != NULL) + add_timer_info(rettv, timer); } else add_timer_info_all(rettv); @@ -909,14 +904,9 @@ f_timer_stop(typval_T *argvars, typval_T *rettv UNUSED) { timer_T *timer; - if (in_vim9script() && check_for_number_arg(argvars, 0) == FAIL) + if (check_for_number_arg(argvars, 0) == FAIL) return; - if (argvars[0].v_type != VAR_NUMBER) - { - emsg(_(e_number_expected)); - return; - } timer = find_timer((int)tv_get_number(&argvars[0])); if (timer != NULL) stop_timer(timer); |