Problem: Failing test for comparing v:null with number.
Solution: Allow comparing v:null with number in legacy script.
(Ken Takata, closes #9873) Also do this for float.
call assert_true(v:true != v:false)
call assert_true(v:null == 0)
+ call assert_false(v:null == 1)
call assert_false(v:null != 0)
call assert_true(v:none == 0)
+ call assert_false(v:none == 1)
call assert_false(v:none != 0)
+ if has('float')
+ call assert_true(v:null == 0.0)
+ call assert_false(v:null == 0.1)
+ call assert_false(v:null != 0.0)
+ endif
call assert_true(v:false is v:false)
call assert_true(v:true is v:true)
case VAR_LIST: return tv->vval.v_list == NULL;
case VAR_PARTIAL: return tv->vval.v_partial == NULL;
case VAR_STRING: return tv->vval.v_string == NULL;
+
+ case VAR_NUMBER: if (!in_vim9script())
+ return tv->vval.v_number == 0;
+ break;
+#ifdef FEAT_FLOAT
+ case VAR_FLOAT: if (!in_vim9script())
+ return tv->vval.v_float == 0.0;
+ break;
+#endif
default: break;
}
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 4489,
/**/
4488,
/**/