0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.2019: Vim9: no support for funcrefs

Problem:  Vim9: no support for funcrefs
Solution: Add support for object/class funcref members

closes: #11981 #12417 #12960 #12324 #13333

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-10-14 11:18:50 +02:00
committed by Christian Brabandt
parent 69fb5afb3b
commit 29bb67f1be
15 changed files with 742 additions and 51 deletions

View File

@@ -5256,6 +5256,7 @@ partial_free(partial_T *pt)
}
else
func_ptr_unref(pt->pt_func);
object_unref(pt->pt_obj);
// "out_up" is no longer used, decrement refcount on partial that owns it.
partial_unref(pt->pt_outer.out_up_partial);
@@ -5578,6 +5579,7 @@ free_unref_items(int copyID)
/*
* PASS 2: free the items themselves.
*/
object_free_items(copyID);
dict_free_items(copyID);
list_free_items(copyID);
@@ -5818,6 +5820,15 @@ set_ref_in_item_partial(
set_ref_in_item(&dtv, copyID, ht_stack, list_stack);
}
if (pt->pt_obj != NULL)
{
typval_T objtv;
objtv.v_type = VAR_OBJECT;
objtv.vval.v_object = pt->pt_obj;
set_ref_in_item(&objtv, copyID, ht_stack, list_stack);
}
for (int i = 0; i < pt->pt_argc; ++i)
abort = abort || set_ref_in_item(&pt->pt_argv[i], copyID,
ht_stack, list_stack);