diff src/evalfunc.c @ 25759:ea0820d05257 v8.2.3415

patch 8.2.3415: Vim9: not all function argument types are properly checked Commit: https://github.com/vim/vim/commit/fc3b775055c2361e507a1a44008d5a7d37eecf14 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Wed Sep 8 14:57:42 2021 +0200 patch 8.2.3415: Vim9: not all function argument types are properly checked Problem: Vim9: Not all function argument types are properly checked. Solution: Add and improve argument type checks. (Yegappan Lakshmanan, closes #8839)
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 Sep 2021 15:00:05 +0200
parents f35efe44dacd
children 8d55e978f95b
line wrap: on
line diff
--- 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, typv
 	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, typv
 	    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;