mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 16:20:06 +00:00
20 lines
372 B
Plaintext
20 lines
372 B
Plaintext
var object = {
|
|
__setter = [
|
|
"field1" = function(self, val)
|
|
print("setter for field1 called!")
|
|
self.x = val
|
|
end
|
|
],
|
|
|
|
__getter = [
|
|
"field1" = function(self)
|
|
print("getter for field1 called!")
|
|
|
|
return self.x + 1
|
|
end
|
|
]
|
|
}
|
|
|
|
object.field1 = 1337
|
|
|
|
print("got field: " .. object.field1) |