mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.4489: failing test for comparing v:null with number
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.
This commit is contained in:
@@ -1405,6 +1405,15 @@ typval_compare_null(typval_T *tv1, typval_T *tv2)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user