__namecall not called on tables #230
-
Debugging lvmexecute.cpp at line 900 I have found that __namecall method is not called on tables. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Canonically in Lua (and Luau preserves this behavior), |
Beta Was this translation helpful? Give feedback.
Canonically in Lua (and Luau preserves this behavior),
obj:method(args)
is equivalent to(obj[method])(obj, args)
, -- to expose methods on the object, usually you'd have the__index
metamethod point to a table with methods, or a C function that returns a function based on the method name. This should still work for tables and userdata alike. __namecall is currently an embedding feature that can accelerate method calls implemented in C/C++, and that's also why it doesn't work on tables - to make sure that we have some freedom to change the behavior if necessary.