0
0
mirror of https://github.com/vim/vim.git synced 2025-10-14 07:04:10 -04:00

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:
Bram Moolenaar
2020-09-05 17:30:44 +02:00
parent 44b4a246b6
commit 2df4731042
3 changed files with 7 additions and 1 deletions

View File

@@ -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;
}