Mercurial Hosting > luan
diff src/luan/LuanJavaFunction.java @ 783:4083f5a67c63
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 30 Aug 2016 12:00:38 -0600 |
parents | 1a68fc55a80c |
children | 626815a4b19b |
line wrap: on
line diff
--- a/src/luan/LuanJavaFunction.java Tue Aug 30 01:29:33 2016 -0600 +++ b/src/luan/LuanJavaFunction.java Tue Aug 30 12:00:38 2016 -0600 @@ -42,29 +42,13 @@ this.varArgCls = null; } } -/* - private LuanJavaFunction(LuanJavaFunction f) { - this.method = f.method; - this.rtnConverter = f.rtnConverter; - this.takesLuaState = f.takesLuaState; - this.argConverters = f.argConverters; - this.varArgCls = f.varArgCls; - } - @Override public LuanJavaFunction shallowClone() { - return obj==null ? this : new LuanJavaFunction(this); - } - - @Override public void deepenClone(LuanJavaFunction clone,DeepCloner cloner) { - clone.obj = cloner.get(obj); - } -*/ @Override public String toString() { return "java-function: " + method; } - public Class[] getParameterTypes() { - return method.getParameterTypes(); + public int getParameterCount() { + return argConverters.length; } @Override public Object call(LuanState luan,Object[] args) throws LuanException { @@ -115,7 +99,7 @@ } private void checkArgs(Object[] args) throws LuanException { - Class[] a = getParameterTypes(); + Class[] a = method.getParameterTypes(); int start = takesLuaState ? 1 : 0; for( int i=start; i<a.length; i++ ) { Class paramType = a[i];