Mercurial > vim
comparison src/vim9instr.c @ 27348:9a9c34c84cd4 v8.2.4202
patch 8.2.4202: Vim9: cannot export function that exists globally
Commit: https://github.com/vim/vim/commit/acc4b5648b49ec13c4f35ee0bf552eda71b0c372
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 24 13:54:45 2022 +0000
patch 8.2.4202: Vim9: cannot export function that exists globally
Problem: Vim9: cannot export function that exists globally.
Solution: When checking if a function already exists only check for
script-local functions. (closes #9615)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 24 Jan 2022 15:00:04 +0100 |
parents | 6ed31017c303 |
children | 1a6421c5be20 |
comparison
equal
deleted
inserted
replaced
27347:b43f497a7e4b | 27348:9a9c34c84cd4 |
---|---|
2048 break; | 2048 break; |
2049 | 2049 |
2050 case ISN_NEWFUNC: | 2050 case ISN_NEWFUNC: |
2051 { | 2051 { |
2052 char_u *lambda = isn->isn_arg.newfunc.nf_lambda; | 2052 char_u *lambda = isn->isn_arg.newfunc.nf_lambda; |
2053 ufunc_T *ufunc = find_func_even_dead(lambda, TRUE); | 2053 ufunc_T *ufunc = find_func_even_dead(lambda, FFED_IS_GLOBAL); |
2054 | 2054 |
2055 if (ufunc != NULL) | 2055 if (ufunc != NULL) |
2056 { | 2056 { |
2057 unlink_def_function(ufunc); | 2057 unlink_def_function(ufunc); |
2058 func_ptr_unref(ufunc); | 2058 func_ptr_unref(ufunc); |