0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.1.0261: Vim9: protected class and funcrefs accessible outside the class

Problem:  Vim9: protected class and funcrefs accessible outside the class
          (Aliaksei Budavei)
Solution: Check if class and object funcrefs are protected
          (Yegappan)

closes: #14407

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2024-04-04 19:35:59 +02:00
committed by Christian Brabandt
parent bd28cae1f1
commit 3e33650b3a
5 changed files with 80 additions and 4 deletions

View File

@@ -2835,6 +2835,14 @@ call_oc_method(
return FAIL;
}
if (*name == '_')
{
// Protected object or class funcref variable
semsg(_(e_cannot_access_protected_variable_str), ocm->ocm_name,
cl->class_name);
return FAIL;
}
if (rettv->v_type == VAR_OBJECT)
{
// funcref object variable