diff src/evalfunc.c @ 22113:a71d7dcba862 v8.2.1606

patch 8.2.1606: Vim9: cannot use "true" with has() Commit: https://github.com/vim/vim/commit/04637e243d39f791cfc97c3ce96d99ef1bf047e1 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 5 18:45:29 2020 +0200 patch 8.2.1606: Vim9: cannot use "true" with has() Problem: Vim9: cannot use "true" with has(). Solution: Use tv_get_bool(). (closes https://github.com/vim/vim/issues/6876)
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Sep 2020 19:00:03 +0200
parents 0825ae9948f7
children b50610a6aee0
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4763,7 +4763,7 @@ f_has(typval_T *argvars, typval_T *rettv
 	}
     }
 
-    if (argvars[1].v_type != VAR_UNKNOWN && tv_get_number(&argvars[1]) != 0)
+    if (argvars[1].v_type != VAR_UNKNOWN && tv_get_bool(&argvars[1]))
 	// return whether feature could ever be enabled
 	rettv->vval.v_number = x;
     else