diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-05-01 19:29:08 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-05-01 19:29:08 +0200 |
commit | c8cd2b34d1027c93fbca90f3cdc8123fe22dfa25 (patch) | |
tree | f0b598e62075135cb334c356d6404908d37ae8f9 /src/userfunc.c | |
parent | 37addecc422c3b62a622b371246dc4ef0a2fa157 (diff) | |
download | vim-git-c8cd2b34d1027c93fbca90f3cdc8123fe22dfa25.tar.gz |
patch 8.2.0677: Vim9: no support for closuresv8.2.0677
Problem: Vim9: no support for closures.
Solution: Find variables in the outer function scope, so long as the scope
exists.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 708b4523b..2493dfea0 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -14,19 +14,6 @@ #include "vim.h" #if defined(FEAT_EVAL) || defined(PROTO) -// flags used in uf_flags -#define FC_ABORT 0x01 // abort function on error -#define FC_RANGE 0x02 // function accepts range -#define FC_DICT 0x04 // Dict function, uses "self" -#define FC_CLOSURE 0x08 // closure, uses outer scope variables -#define FC_DELETED 0x10 // :delfunction used while uf_refcount > 0 -#define FC_REMOVED 0x20 // function redefined while uf_refcount > 0 -#define FC_SANDBOX 0x40 // function defined in the sandbox -#define FC_DEAD 0x80 // function kept only for reference to dfunc -#define FC_EXPORT 0x100 // "export def Func()" -#define FC_NOARGS 0x200 // no a: variables in lambda -#define FC_VIM9 0x400 // defined in vim9 script file - /* * All user-defined functions are found in this hashtable. */ @@ -3267,7 +3254,7 @@ ex_function(exarg_T *eap) // ":def Func()" needs to be compiled if (eap->cmdidx == CMD_def) - compile_def_function(fp, FALSE); + compile_def_function(fp, FALSE, NULL); goto ret_free; |