comparison src/typval.c @ 33008:ba1b40b520e8 v9.0.1796

patch 9.0.1796: Vim9 problems with null_objects Commit: https://github.com/vim/vim/commit/5c018bee0e1e272774584cfb1577327fbb67254a Author: Ernie Rael <errael@raelity.com> Date: Sun Aug 27 18:40:26 2023 +0200 patch 9.0.1796: Vim9 problems with null_objects Problem: Vim9 problems with null_objects Solution: Vim9 improve null_object usage Fix "xvar == null", where xvar might have been assigned null_object. Fix compilation failure: "var o2: C = null_object". closes: #12890 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ernie Rael <errael@raelity.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 18:45:08 +0200
parents 75c283beb74f
children 667a17904f64
comparison
equal deleted inserted replaced
33007:e7561ca6e020 33008:ba1b40b520e8
1576 { 1576 {
1577 case VAR_BLOB: return tv->vval.v_blob == NULL; 1577 case VAR_BLOB: return tv->vval.v_blob == NULL;
1578 #ifdef FEAT_JOB_CHANNEL 1578 #ifdef FEAT_JOB_CHANNEL
1579 case VAR_CHANNEL: return tv->vval.v_channel == NULL; 1579 case VAR_CHANNEL: return tv->vval.v_channel == NULL;
1580 #endif 1580 #endif
1581 // TODO: null_class handling
1582 // case VAR_CLASS: return tv->vval.v_class == NULL;
1581 case VAR_DICT: return tv->vval.v_dict == NULL; 1583 case VAR_DICT: return tv->vval.v_dict == NULL;
1582 case VAR_FUNC: return tv->vval.v_string == NULL; 1584 case VAR_FUNC: return tv->vval.v_string == NULL;
1583 #ifdef FEAT_JOB_CHANNEL 1585 #ifdef FEAT_JOB_CHANNEL
1584 case VAR_JOB: return tv->vval.v_job == NULL; 1586 case VAR_JOB: return tv->vval.v_job == NULL;
1585 #endif 1587 #endif
1586 case VAR_LIST: return tv->vval.v_list == NULL; 1588 case VAR_LIST: return tv->vval.v_list == NULL;
1589 case VAR_OBJECT: return tv->vval.v_object == NULL;
1587 case VAR_PARTIAL: return tv->vval.v_partial == NULL; 1590 case VAR_PARTIAL: return tv->vval.v_partial == NULL;
1588 case VAR_STRING: return tv->vval.v_string == NULL; 1591 case VAR_STRING: return tv->vval.v_string == NULL;
1589 1592
1590 case VAR_NUMBER: if (!in_vim9script()) 1593 case VAR_NUMBER: if (!in_vim9script())
1591 return tv->vval.v_number == 0; 1594 return tv->vval.v_number == 0;