variable number of arguments for user defined functions.

This commit is contained in:
gnembon committed 2020-09-22 04:38:08 -03:00
1 parent 7de132eb56
commit e8b2060fb3
15 files changed
+168 -68

No files matched your search

@@ -309,7 +309,12 @@ public class CarpetScriptHost extends ScriptHost
{
if (CarpetServer.scriptServer.stopAll)
return Value.NULL;
if (argv.size() != fun.getArguments().size())
try { // cause we can't throw checked exceptions in lambda. Left if be until need to handle these more gracefully
fun.assertArgsOk(argv.size(), (b) -> {
throw new InternalExpressionException("");
});
}
catch (InternalExpressionException ignored)
{
throw new InvalidCallbackException();
}