Commit fa3a67dc authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Removed delagate hack on Metatable.cs

parent 27e4f04c
...@@ -608,15 +608,7 @@ namespace NLua ...@@ -608,15 +608,7 @@ namespace NLua
try { try {
var value = field.GetValue (obj); var value = field.GetValue (obj);
if (!(value is Delegate)) { translator.Push (luaState, value);
translator.Push (luaState, value);
} else {
Delegate del = (Delegate)value;
var wrapper = new LuaNativeFunction ((new LuaMethodWrapper (translator, del.Target, objType, del.Method)).invokeFunction);
translator.PushFunction (luaState, wrapper);
translator.Push (luaState, true);
return 2;
}
} catch { } catch {
LuaLib.LuaPushNil (luaState); LuaLib.LuaPushNil (luaState);
} }
...@@ -631,15 +623,8 @@ namespace NLua ...@@ -631,15 +623,8 @@ namespace NLua
try { try {
object value = property.GetValue (obj, null); object value = property.GetValue (obj, null);
if (!(value is Delegate)) { translator.Push (luaState, value);
translator.Push (luaState, value);
} else {
Delegate del = (Delegate)value;
var wrapper = new LuaNativeFunction ((new LuaMethodWrapper (translator, del.Target, objType, del.Method)).invokeFunction);
translator.PushFunction (luaState, wrapper);
translator.Push (luaState, true);
return 2;
}
} catch (ArgumentException) { } catch (ArgumentException) {
// If we can't find the getter in our class, recurse up to the base class and see // If we can't find the getter in our class, recurse up to the base class and see
// if they can help. // if they can help.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment