diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-09 11:56:21 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-09 11:56:21 +0000 |
commit | f3507a517c38bee5498736607ead64c8ae6b5941 (patch) | |
tree | cad30f34ea6d915800ce7170d28acf09d43b6976 /src/typval.c | |
parent | 1588bc8ebee22f2855f27273fc2234fff370f86c (diff) |
patch 8.2.4530: making comparison with null work changes legacy behaviorv8.2.4530
Problem: Making comparison with null work changes legacy behavior.
Solution: Only use the better comparison in Vim9 script. (closes #9910)
Diffstat (limited to 'src/typval.c')
-rw-r--r-- | src/typval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/typval.c b/src/typval.c index e89ba9e760..53512c6498 100644 --- a/src/typval.c +++ b/src/typval.c @@ -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; |