1
0
forked from aniani/vim

patch 8.2.2075: error for const argument to mapnew()

Problem:    Error for const argument to mapnew().
Solution:   Don't give an error. (closes #7400)
This commit is contained in:
Bram Moolenaar
2020-12-01 21:08:05 +01:00
parent 4324d87a44
commit 57cf4973a2
3 changed files with 11 additions and 3 deletions

View File

@@ -2065,7 +2065,7 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap)
--todo;
di = HI2DI(hi);
if (filtermap != FILTERMAP_FILTER
if (filtermap == FILTERMAP_MAP
&& (value_check_lock(di->di_tv.v_lock,
arg_errmsg, TRUE)
|| var_check_ro(di->di_flags,
@@ -2225,12 +2225,12 @@ filter_map(typval_T *argvars, typval_T *rettv, filtermap_T filtermap)
}
else
{
// Materialized list from range(): loop over the items
// Materialized list: loop over the items
for (li = l->lv_first; li != NULL; li = nli)
{
typval_T newtv;
if (filtermap != FILTERMAP_FILTER && value_check_lock(
if (filtermap == FILTERMAP_MAP && value_check_lock(
li->li_tv.v_lock, arg_errmsg, TRUE))
break;
nli = li->li_next;