summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2015-02-25 15:16:35 +0000
committerDaniel Kolesa <d.kolesa@samsung.com>2015-02-25 15:16:35 +0000
commit1e83761810e337eac94bb94f39053f511b0a1083 (patch)
tree6f72243f1b662a3280228e1540ef85178d2dd2e4
parent212571c40618f0b3a1c336d73548fd021e6cd278 (diff)
elua: multiple inheritance aware is_a
-rw-r--r--src/scripts/elua/core/util.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/scripts/elua/core/util.lua b/src/scripts/elua/core/util.lua
index 533389904f..e6d59f4ef2 100644
--- a/src/scripts/elua/core/util.lua
+++ b/src/scripts/elua/core/util.lua
@@ -52,13 +52,13 @@ M.Object = {
52 52
53 is_a = function(self, base) 53 is_a = function(self, base)
54 if self == base then return true end 54 if self == base then return true end
55 local pt = self.__proto 55 local protos = self.__protos
56 local is = (pt == base) 56 for i = 1, #protos do
57 while not is and pt do 57 if protos[i]:is_a(base) then
58 pt = pt.__proto 58 return true
59 is = (pt == base) 59 end
60 end 60 end
61 return is 61 return false
62 end, 62 end,
63 63
64 add_parent = function(self, parent) 64 add_parent = function(self, parent)