projects
/
luaproto
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb996bf
)
protect the metatable
author
Christian Thaeter
<ct@pipapo.org>
Fri, 14 Nov 2014 22:46:16 +0000
(23:46 +0100)
committer
Christian Thaeter
<ct@pipapo.org>
Fri, 14 Nov 2014 22:46:16 +0000
(23:46 +0100)
proto.lua
patch
|
blob
|
history
diff --git
a/proto.lua
b/proto.lua
index
b2fca52
..
8dfc300
100644
(file)
--- a/
proto.lua
+++ b/
proto.lua
@@
-15,11
+15,11
@@
---
---
---
----
-- Object is the root object for all objects to be created
local Object = {}
+Object.__metatable = Object
setmetatable(Object, Object)
--- Object:proto_clone ()
@@
-29,6
+29,7
@@
setmetatable(Object, Object)
function Object:proto_clone(newobject)
assert(not newobject or type(newobject) == 'table')
newobject = newobject or {}
+ newobject.__metatable = newobject
setmetatable(newobject, newobject)
newobject.__index = self