diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-12-16 14:11:19 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-12-16 14:11:19 +0100 |
commit | e5437c542709b77ade084f96e60d84d4e847e6d3 (patch) | |
tree | 3740cd5c1dea8039f504fcbfb10b07086bdf08bf /src/eval.c | |
parent | d8bf87c9fbd92fd6b837446e886d47e557adadbc (diff) |
patch 9.0.2170: Vim9: no support for const/final class/objects varsv9.0.2170
Problem: Vim9: no support for const/final class/objects vars
Solution: Support final and const object and class variables
closes: #13655
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 0579a85f69..877a20ff28 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1778,6 +1778,13 @@ get_lval( p, flags) == FAIL) return NULL; + // When lhs is used to modify the variable, check it is + // not a read-only variable. + if ((flags & GLV_READ_ONLY) == 0 + && (*p != '.' && *p != '[') + && oc_var_check_ro(cl, om)) + return NULL; + lp->ll_valtype = om->ocm_type; if (v_type == VAR_OBJECT) |