patch 8.2.0650: Vim9: script function can be deleted
Problem: Vim9: script function can be deleted.
Solution: Disallow deleting script function. Delete functions when sourcing
a script again.
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 0e9abac..89a8677 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2210,7 +2210,7 @@
static int
generate_funcref(cctx_T *cctx, char_u *name)
{
- ufunc_T *ufunc = find_func(name, cctx);
+ ufunc_T *ufunc = find_func(name, FALSE, cctx);
if (ufunc == NULL)
return FAIL;
@@ -2452,7 +2452,7 @@
}
// If we can find the function by name generate the right call.
- ufunc = find_func(name, cctx);
+ ufunc = find_func(name, FALSE, cctx);
if (ufunc != NULL)
{
res = generate_CALL(cctx, ufunc, argcount);