mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.0703: Vim9: closure cannot store value in outer context (#28925)
Problem: Vim9: closure cannot store value in outer context.
Solution: Make storing value in outer context work. Make :disassemble
accept a function reference.
b68b346e6d
Funcstack is Vim9script-only.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
parent
5cbd6d9b9f
commit
a599183a27
@ -4836,8 +4836,10 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack
|
|||||||
case VAR_PARTIAL: {
|
case VAR_PARTIAL: {
|
||||||
partial_T *pt = tv->vval.v_partial;
|
partial_T *pt = tv->vval.v_partial;
|
||||||
|
|
||||||
// A partial does not have a copyID, because it cannot contain itself.
|
if (pt != NULL && pt->pt_copyID != copyID) {
|
||||||
if (pt != NULL) {
|
// Didn't see this partial yet.
|
||||||
|
pt->pt_copyID = copyID;
|
||||||
|
|
||||||
abort = set_ref_in_func(pt->pt_name, pt->pt_func, copyID);
|
abort = set_ref_in_func(pt->pt_name, pt->pt_func, copyID);
|
||||||
if (pt->pt_dict != NULL) {
|
if (pt->pt_dict != NULL) {
|
||||||
typval_T dtv;
|
typval_T dtv;
|
||||||
|
@ -364,6 +364,7 @@ struct ufunc {
|
|||||||
|
|
||||||
struct partial_S {
|
struct partial_S {
|
||||||
int pt_refcount; ///< Reference count.
|
int pt_refcount; ///< Reference count.
|
||||||
|
int pt_copyID;
|
||||||
char *pt_name; ///< Function name; when NULL use pt_func->name.
|
char *pt_name; ///< Function name; when NULL use pt_func->name.
|
||||||
ufunc_T *pt_func; ///< Function pointer; when NULL lookup function with pt_name.
|
ufunc_T *pt_func; ///< Function pointer; when NULL lookup function with pt_name.
|
||||||
bool pt_auto; ///< When true the partial was created by using dict.member
|
bool pt_auto; ///< When true the partial was created by using dict.member
|
||||||
|
Loading…
Reference in New Issue
Block a user