luaj
luaj copied to clipboard
Fix varargs invocation from luajava
The arguments for a varargs method/constructor should be the fixed arguments, followed by an array of the variable arguments, rather than a flat array of all the arguments (see §15.12.4.2 of the Java language specs).
This allows varargs methods to be called from luajava:
local System = luajava.bindClass("java.lang.System")
System.out:printf("%s, %s\n!", "Hello", "world")