Mercurial > vim
diff src/proto/vim9class.pro @ 35497:ae2cc753b57f v9.1.0514
patch 9.1.0514: Vim9: issue with comparing objects recursively
Commit: https://github.com/vim/vim/commit/7b29cc97d6c1450865969d08c5538a40c304593c
Author: LemonBoy <thatlemon@gmail.com>
Date: Sat Jun 22 17:25:07 2024 +0200
patch 9.1.0514: Vim9: issue with comparing objects recursively
Problem: Vim9: issue with comparing objects recursively
(Yinzuo Jiang)
Solution: only set recursive == TRUE, when called from tv_equal(), not
from typeval_compare_object(), refactor code into object_equal()
function (LemonBoy)
The recursive flag in tv_equal should be set only when the caller is
tv_equal, meaning that the comparison depth is > 1. The comparison
predicates for other object types are all following this rule, except
for the object one, and that may cause some weird issues like causing
the max depth limit not to be initialized in some cases.
closes: #15076
Signed-off-by: LemonBoy <thatlemon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 22 Jun 2024 17:45:04 +0200 |
parents | c10c6d293ef7 |
children | b39982468366 |
line wrap: on
line diff
--- a/src/proto/vim9class.pro +++ b/src/proto/vim9class.pro @@ -40,6 +40,7 @@ int is_class_name(char_u *name, typval_T void protected_method_access_errmsg(char_u *method_name); int object_empty(object_T *obj); int object_len(object_T *obj); +int object_equal(object_T *o1, object_T *o2, int ic, int recursive); char_u *object2string(object_T *obj, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); int class_instance_of(class_T *cl, class_T *other_cl); void f_instanceof(typval_T *argvars, typval_T *rettv);