diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-11 21:19:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-11 21:19:34 +0100 |
commit | f785aa1354208f6b644e891aa01f8f86d947af7e (patch) | |
tree | aa9ed2fee106094256c479215ab91ec129d3d763 /src/vim9script.c | |
parent | 0bcadf14aa700c166c09f1800ed3de00b9598b39 (diff) | |
download | vim-git-f785aa1354208f6b644e891aa01f8f86d947af7e.tar.gz |
patch 8.2.2501: not always clear where an error is reportedv8.2.2501
Problem: Not always clear where an error is reported.
Solution: Add the where_T structure and pass it around. (closes #7796)
Diffstat (limited to 'src/vim9script.c')
-rw-r--r-- | src/vim9script.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/vim9script.c b/src/vim9script.c index 387c9bedc..fea478592 100644 --- a/src/vim9script.c +++ b/src/vim9script.c @@ -650,7 +650,7 @@ vim9_declare_scriptvar(exarg_T *eap, char_u *arg) init_tv.v_type = VAR_NUMBER; else init_tv.v_type = type->tt_type; - set_var_const(name, type, &init_tv, FALSE, 0); + set_var_const(name, type, &init_tv, FALSE, 0, 0); vim_free(name); return p; @@ -855,7 +855,7 @@ find_typval_in_script(typval_T *dest) if (sv->sv_name != NULL && sv->sv_tv == dest) return sv; } - iemsg("check_script_var_type(): not found"); + iemsg("find_typval_in_script(): not found"); return NULL; } @@ -864,7 +864,11 @@ find_typval_in_script(typval_T *dest) * If needed convert "value" to a bool. */ int -check_script_var_type(typval_T *dest, typval_T *value, char_u *name) +check_script_var_type( + typval_T *dest, + typval_T *value, + char_u *name, + where_T where) { svar_T *sv = find_typval_in_script(dest); int ret; @@ -876,7 +880,7 @@ check_script_var_type(typval_T *dest, typval_T *value, char_u *name) semsg(_(e_readonlyvar), name); return FAIL; } - ret = check_typval_type(sv->sv_type, value, 0); + ret = check_typval_type(sv->sv_type, value, where); if (ret == OK && need_convert_to_bool(sv->sv_type, value)) { int val = tv2bool(value); |