From fcf36aeb8c5477677026626bb572db7f3185d9d4 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Sat, 8 Jun 2013 00:06:56 -0700 Subject: [PATCH] fix moon.mixin, fixes #99 --- moon/init.lua | 3 +-- moon/init.moon | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/moon/init.lua b/moon/init.lua index f05fe07..91d20e2 100644 --- a/moon/init.lua +++ b/moon/init.lua @@ -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 diff --git a/moon/init.moon b/moon/init.moon index 7fd6c59..ef07bba 100644 --- a/moon/init.moon +++ b/moon/init.moon @@ -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, ...