fix moon.mixin, fixes #99

This commit is contained in:
leaf corcoran 2013-06-08 00:06:56 -07:00
parent 2f4066d9bb
commit fcf36aeb8c
2 changed files with 2 additions and 4 deletions

View File

@ -117,8 +117,7 @@ copy = function(self)
end)()
end
mixin = function(self, cls, ...)
local meta = getmetatable(cls)
for key, val in pairs(meta.__index) do
for key, val in pairs(cls.__base) do
if not key:match("^__") then
self[key] = val
end

View File

@ -100,8 +100,7 @@ copy = =>
-- mixin class properties into self, call new
mixin = (cls, ...) =>
meta = getmetatable cls
for key, val in pairs meta.__index
for key, val in pairs cls.__base
self[key] = val if not key\match"^__"
cls.__init self, ...