0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.1887: Vim9: class members are accessible via object

Problem:  Vim9: class members are accessible via object
Solution: Disable class member variable access using an object

Class methods can be accessed only using the class name and cannot be
accessed using an object. To be consistent with this, do the same for
class member variables also. They can be accessed only using the class
name and not using an object.

closes: #13057

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-09-09 11:33:29 +02:00
committed by Christian Brabandt
parent ee17b6f70d
commit 23c92d93c1
4 changed files with 65 additions and 78 deletions

View File

@@ -1966,8 +1966,7 @@ class_object_index(
{
// Search in the object member variable table and the class member
// variable table.
if (get_member_tv(cl, TRUE, name, len, rettv) == OK
|| get_member_tv(cl, FALSE, name, len, rettv) == OK)
if (get_member_tv(cl, TRUE, name, len, rettv) == OK)
{
*arg = name_end;
return OK;