mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.4530: making comparison with null work changes legacy behavior
Problem: Making comparison with null work changes legacy behavior. Solution: Only use the better comparison in Vim9 script. (closes #9910)
This commit is contained in:
@@ -1381,7 +1381,7 @@ typval_compare_list(
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare v:null/v:none with another type. Return TRUE if the value is NULL.
|
||||
* Compare v:null with another type. Return TRUE if the value is NULL.
|
||||
*/
|
||||
int
|
||||
typval_compare_null(typval_T *tv1, typval_T *tv2)
|
||||
@@ -1417,6 +1417,9 @@ typval_compare_null(typval_T *tv1, typval_T *tv2)
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (!in_vim9script())
|
||||
return FALSE; // backwards compatible
|
||||
|
||||
semsg(_(e_cannot_compare_str_with_str),
|
||||
vartype_name(tv1->v_type), vartype_name(tv2->v_type));
|
||||
return MAYBE;
|
||||
|
Reference in New Issue
Block a user