1
0
forked from aniani/vim

patch 8.2.3897: Vim9: second argument of map() and filter() not checked

Problem:    Vim9: the second argument of map() and filter() is not checked at
            compile time.
Solution:   Add more specific type check for the second argument.
This commit is contained in:
Bram Moolenaar
2021-12-25 21:43:28 +00:00
parent db8e5c21b9
commit 1802405d71
7 changed files with 80 additions and 12 deletions

View File

@@ -2280,7 +2280,7 @@ filter_map_one(
// filter(): when expr is zero remove the item
if (in_vim9script())
*remp = !tv2bool(newtv);
*remp = !tv_get_bool_chk(newtv, &error);
else
*remp = (tv_get_number_chk(newtv, &error) == 0);
clear_tv(newtv);