diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-27 22:47:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-27 22:47:51 +0200 |
commit | 4c17ad94ecb0a0fb26d6fface2614bc5172dea18 (patch) | |
tree | 3b26b172e38be6c1d762c58d7517ac79e21e0a0f /src/proto/userfunc.pro | |
parent | db93495d276642f63f80471fbcb900b9aa1e9e42 (diff) | |
download | vim-git-4c17ad94ecb0a0fb26d6fface2614bc5172dea18.tar.gz |
patch 8.2.0650: Vim9: script function can be deletedv8.2.0650
Problem: Vim9: script function can be deleted.
Solution: Disallow deleting script function. Delete functions when sourcing
a script again.
Diffstat (limited to 'src/proto/userfunc.pro')
-rw-r--r-- | src/proto/userfunc.pro | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro index 19097fe2e..81d69386f 100644 --- a/src/proto/userfunc.pro +++ b/src/proto/userfunc.pro @@ -7,11 +7,12 @@ char_u *deref_func_name(char_u *name, int *lenp, partial_T **partialp, int no_au void emsg_funcname(char *ermsg, char_u *name); int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, funcexe_T *funcexe); char_u *fname_trans_sid(char_u *name, char_u *fname_buf, char_u **tofree, int *error); -ufunc_T *find_func(char_u *name, cctx_T *cctx); +ufunc_T *find_func(char_u *name, int is_global, cctx_T *cctx); int call_user_func_check(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, funcexe_T *funcexe, dict_T *selfdict); void save_funccal(funccal_entry_T *entry); void restore_funccal(void); funccall_T *get_current_funccal(void); +void delete_script_functions(int sid); void free_all_functions(void); int builtin_function(char_u *name, int len); int func_call(char_u *name, typval_T *args, partial_T *partial, dict_T *selfdict, typval_T *rettv); @@ -19,11 +20,11 @@ int get_callback_depth(void); int call_callback(callback_T *callback, int len, typval_T *rettv, int argcount, typval_T *argvars); void user_func_error(int error, char_u *name); int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe); -char_u *trans_function_name(char_u **pp, int skip, int flags, funcdict_T *fdp, partial_T **partial); +char_u *trans_function_name(char_u **pp, int *is_global, int skip, int flags, funcdict_T *fdp, partial_T **partial); char_u *untrans_function_name(char_u *name); void ex_function(exarg_T *eap); int eval_fname_script(char_u *p); -int translated_function_exists(char_u *name); +int translated_function_exists(char_u *name, int is_global); int has_varargs(ufunc_T *ufunc); int function_exists(char_u *name, int no_deref); char_u *get_expanded_name(char_u *name, int check); |