diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-09-08 14:57:42 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-08 14:57:42 +0200 |
commit | fc3b775055c2361e507a1a44008d5a7d37eecf14 (patch) | |
tree | 13683ebfabf7a13db8be1f97ddecab7d4b4e4899 /src/evalfunc.c | |
parent | 80c88eac5a81dd9f1a96fc80cb8aab6c84fe7b86 (diff) |
patch 8.2.3415: Vim9: not all function argument types are properly checkedv8.2.3415
Problem: Vim9: Not all function argument types are properly checked.
Solution: Add and improve argument type checks. (Yegappan Lakshmanan,
closes #8839)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index b3f69c1f3b..47290ddeed 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1305,9 +1305,9 @@ static funcentry_T global_functions[] = ret_number, f_diff_hlID}, {"digraph_get", 1, 1, FEARG_1, arg1_string, ret_string, f_digraph_get}, - {"digraph_getlist",0, 1, FEARG_1, arg1_number, + {"digraph_getlist",0, 1, FEARG_1, arg1_bool, ret_list_string_items, f_digraph_getlist}, - {"digraph_set", 2, 2, FEARG_1, arg2_string_number, + {"digraph_set", 2, 2, FEARG_1, arg2_string, ret_bool, f_digraph_set}, {"digraph_setlist",1, 1, FEARG_1, arg1_list_string, ret_bool, f_digraph_setlist}, @@ -2954,8 +2954,6 @@ f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED) error = TRUE; if (argvars[1].v_type != VAR_UNKNOWN) { - if (in_vim9script() && check_for_string_arg(argvars, 1) == FAIL) - return; buttons = tv_get_string_buf_chk(&argvars[1], buf); if (buttons == NULL) error = TRUE; @@ -2964,8 +2962,6 @@ f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED) def = (int)tv_get_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { - if (in_vim9script() && check_for_string_arg(argvars, 3) == FAIL) - return; typestr = tv_get_string_buf_chk(&argvars[3], buf2); if (typestr == NULL) error = TRUE; |