1
0
forked from aniani/vim

patch 8.2.4455: accepting one and zero for second sort() argument is strange

Problem:    Accepting one and zero for the second sort() argument is strange.
Solution:   Disallow using one and zero in Vim9 script.
This commit is contained in:
Bram Moolenaar
2022-02-23 13:17:47 +00:00
parent 6a8b13614e
commit 2007dd49f5
6 changed files with 29 additions and 16 deletions

View File

@@ -2198,7 +2198,8 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
if (in_vim9script()
&& (check_for_list_arg(argvars, 0) == FAIL
|| (argvars[1].v_type != VAR_UNKNOWN
&& check_for_opt_dict_arg(argvars, 2) == FAIL)))
&& (check_for_string_or_func_arg(argvars, 1) == FAIL
|| check_for_opt_dict_arg(argvars, 2) == FAIL))))
return;
if (argvars[0].v_type != VAR_LIST)