comparison src/eval.c @ 7951:03e716299680 v7.4.1271

commit https://github.com/vim/vim/commit/3712792637516aea7acf76a11533be1066952820 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 6 20:29:28 2016 +0100 patch 7.4.1271 Problem: assert_false(v:false) reports an error. (Nikolai Pavlov) Solution: Recognize v:true and v:false. (Closes https://github.com/vim/vim/issues/625)
author Christian Brabandt <cb@256bit.org>
date Sat, 06 Feb 2016 20:30:05 +0100
parents e875f0fbd9c0
children a4de8e834b8f
comparison
equal deleted inserted replaced
7950:38b8e3702798 7951:03e716299680
9214 assert_bool(typval_T *argvars, int isTrue) 9214 assert_bool(typval_T *argvars, int isTrue)
9215 { 9215 {
9216 int error = FALSE; 9216 int error = FALSE;
9217 garray_T ga; 9217 garray_T ga;
9218 9218
9219 if (argvars[0].v_type == VAR_SPECIAL
9220 && argvars[0].vval.v_number == (isTrue ? VVAL_TRUE : VV_FALSE))
9221 return;
9219 if (argvars[0].v_type != VAR_NUMBER 9222 if (argvars[0].v_type != VAR_NUMBER
9220 || (get_tv_number_chk(&argvars[0], &error) == 0) == isTrue 9223 || (get_tv_number_chk(&argvars[0], &error) == 0) == isTrue
9221 || error) 9224 || error)
9222 { 9225 {
9223 prepare_assert_error(&ga); 9226 prepare_assert_error(&ga);