2020-12-05 23:58:56 +00:00
|
|
|
// crafts a dummy proto
|
2020-12-30 23:51:59 +00:00
|
|
|
proto test
|
2023-02-09 21:58:25 +00:00
|
|
|
func __init(self) end
|
2020-12-30 23:51:59 +00:00
|
|
|
end
|
2020-11-10 01:44:12 +00:00
|
|
|
|
2020-11-19 20:41:21 +00:00
|
|
|
// instance of test
|
2023-02-09 21:58:25 +00:00
|
|
|
let obj = test()
|
2020-11-10 01:44:12 +00:00
|
|
|
|
2020-11-17 01:58:16 +00:00
|
|
|
test.__index = function(self, key)
|
|
|
|
print("__index called!")
|
|
|
|
if (key == "lol") then
|
|
|
|
return 9001
|
2020-11-10 01:44:12 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-11-19 20:41:21 +00:00
|
|
|
print(obj["lol"]) // should print 9001?
|