aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-09-24 13:37:26 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-09-24 13:37:26 +0100
commit85a135d32e26b29c842a37bb581ae0a7d0ab6d8a (patch)
tree96b21ea9b4152ae2f1b6b51273d0b0cb89683e09
parentelua: Eo metatype with method table redirection (diff)
downloadefl-85a135d32e26b29c842a37bb581ae0a7d0ab6d8a.tar.gz
elua: remove the eo_methods stuff, improve class registration
-rw-r--r--src/bindings/luajit/eo.lua15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua
index e72db2a64e..a74bee43d8 100644
--- a/src/bindings/luajit/eo.lua
+++ b/src/bindings/luajit/eo.lua
@@ -137,11 +137,8 @@ M.class_get = function(name)
return classes[name]
end
-M.class_register = function(name, val, addr)
+M.class_register = function(name, val)
classes[name] = val
- if addr then
- classes[tonumber(ffi.cast("intptr_t", addr))] = val
- end
return val
end
@@ -181,24 +178,20 @@ M.__do_end = function()
-- only for cleanup (dtor)
end
-local eo_methods = {
-}
-
ffi.metatype("Eo", {
__index = function(self, key)
- local v = rawget(eo_methods, key)
- if v ~= nil then return v end
local cl = eo.eo_class_get(self)
if cl == nil then return nil end
local nm = eo.eo_class_name_get(cl)
if nm == nil then return nil end
- local mt == classes[nm]
+ local mt == classes[ffi.string(nm)]
if mt == nil then return nil end
return mt[key]
end
})
-M.Eo_Base = util.Object:clone {
+M.Base = util.Object:clone {
}
+M.class_register("Eo.Base", M.Base)
return M