vim-patch:8.2.1576: Vim9: index() does not take "true" as argument

Problem:    Vim9: index() does not take "true" as argument.
Solution:   Use tv_get_bool_chk(). (closes vim/vim#6823)

6c553f9c04

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2026-08-08 00:24:02 -04:00
parent b055504d41
commit ecbae9911e

View File

@@ -2838,7 +2838,7 @@ static void f_index(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
assert(item != NULL);
}
if (argvars[3].v_type != VAR_UNKNOWN) {
ic = !!tv_get_number_chk(&argvars[3], &error);
ic = !!tv_get_bool_chk(&argvars[3], &error);
if (error) {
item = NULL;
}