0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1798: Vim9: trinary operator condition is too permissive

Problem:    Vim9: trinary operator condition is too permissive.
Solution:   Use tv_get_bool_chk().
This commit is contained in:
Bram Moolenaar
2020-10-04 16:06:05 +02:00
parent 6abd3dc257
commit 1310660557
10 changed files with 215 additions and 36 deletions

View File

@@ -1908,6 +1908,7 @@ call_def_function(
{
tv = STACK_TV_BOT(-1);
if (when == JUMP_IF_COND_FALSE
|| when == JUMP_IF_FALSE
|| when == JUMP_IF_COND_TRUE)
{
SOURCING_LNUM = iptr->isn_lnum;
@@ -3403,7 +3404,7 @@ ex_disassemble(exarg_T *eap)
}
/*
* Return TRUE when "tv" is not falsey: non-zero, non-empty string, non-empty
* Return TRUE when "tv" is not falsy: non-zero, non-empty string, non-empty
* list, etc. Mostly like what JavaScript does, except that empty list and
* empty dictionary are FALSE.
*/