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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user