forked from aniani/vim
patch 8.2.1601: Vim9: cannot use 'true" with garbagecollect()
Problem: Vim9: cannot use 'true" with garbagecollect(). Solution: Use tv_get_bool(). (closes #6871)
This commit is contained in:
@@ -2936,7 +2936,7 @@ f_garbagecollect(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
// using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]".
|
||||
want_garbage_collect = TRUE;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN && tv_get_number(&argvars[0]) == 1)
|
||||
if (argvars[0].v_type != VAR_UNKNOWN && tv_get_bool(&argvars[0]) == 1)
|
||||
garbage_collect_at_exit = TRUE;
|
||||
}
|
||||
|
||||
|
@@ -1285,6 +1285,10 @@ def Test_extend_return_type()
|
||||
assert_equal(6, res)
|
||||
enddef
|
||||
|
||||
def Test_garbagecollect()
|
||||
garbagecollect(true)
|
||||
enddef
|
||||
|
||||
def Test_insert_return_type()
|
||||
let l = insert([2, 1], 3)
|
||||
let res = 0
|
||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1601,
|
||||
/**/
|
||||
1600,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user