mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
16 lines
264 B
Plaintext
16 lines
264 B
Plaintext
// crafts a dummy proto
|
|
proto test
|
|
func __init(self) end
|
|
end
|
|
|
|
// instance of test
|
|
let obj = test()
|
|
|
|
test.__index = func(self, key)
|
|
print("__index called!")
|
|
if (key == "lol") then
|
|
return 9001
|
|
end
|
|
end
|
|
|
|
print(obj["lol"]) // should print 9001? |