summaryrefslogtreecommitdiff
path: root/src/vim9execute.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-17 20:15:38 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-17 20:15:38 +0000
commit71b768509250b12696e8cc90e5902029f1b5433d (patch)
treecedd129c1f525760d90fde63fa163642f590a1a0 /src/vim9execute.c
parentddc80aff575dd60c04c79621a0358cf0abaac53a (diff)
downloadvim-git-71b768509250b12696e8cc90e5902029f1b5433d.tar.gz
patch 8.2.3841: Vim9: outdated TODO items, disabled tests that workv8.2.3841
Problem: Vim9: outdated TODO items, disabled tests that work. Solution: Remove TODO items, run tests that work now. Check that a dict item isn't locked.
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r--src/vim9execute.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 14091b048..a376d00a5 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -915,7 +915,6 @@ call_ufunc(
// The function has been compiled, can call it quickly. For a function
// that was defined later: we can call it directly next time.
- // TODO: what if the function was deleted and then defined again?
if (iptr != NULL)
{
delete_instr(iptr);
@@ -933,7 +932,6 @@ call_ufunc(
funcexe.fe_selfdict = selfdict != NULL ? selfdict : dict_stack_get_dict();
// Call the user function. Result goes in last position on the stack.
- // TODO: add selfdict if there is one
error = call_user_func_check(ufunc, argcount, argvars,
STACK_TV_BOT(-1), &funcexe, funcexe.fe_selfdict);
@@ -2862,21 +2860,29 @@ exec_instructions(ectx_T *ectx)
char_u *key = tv_idx->vval.v_string;
dictitem_T *di = NULL;
- if (key == NULL)
- key = (char_u *)"";
- if (d != NULL)
- di = dict_find(d, key, (int)STRLEN(key));
- if (di == NULL)
- {
- // NULL dict is equivalent to empty dict
- SOURCING_LNUM = iptr->isn_lnum;
- semsg(_(e_dictkey), key);
+ if (d != NULL && value_check_lock(
+ d->dv_lock, NULL, FALSE))
status = FAIL;
- }
else
{
- // TODO: check for dict or item locked
- dictitem_remove(d, di);
+ SOURCING_LNUM = iptr->isn_lnum;
+ if (key == NULL)
+ key = (char_u *)"";
+ if (d != NULL)
+ di = dict_find(d, key, (int)STRLEN(key));
+ if (di == NULL)
+ {
+ // NULL dict is equivalent to empty dict
+ semsg(_(e_dictkey), key);
+ status = FAIL;
+ }
+ else if (var_check_fixed(di->di_flags,
+ NULL, FALSE)
+ || var_check_ro(di->di_flags,
+ NULL, FALSE))
+ status = FAIL;
+ else
+ dictitem_remove(d, di);
}
}
}