make constructors work

This commit is contained in:
Daniella / Tove 2022-04-17 19:17:57 +02:00
parent f5307d2b97
commit 9c6a4cc98a

View file

@ -999,6 +999,7 @@ public class ISBPL {
for (Constructor<?> constructor : clazz.getDeclaredConstructors()) {
addFunction(type, "new" + constructor.getParameterCount(), stack -> {
constructor.setAccessible(true);
stack.pop();
Object[] params = new Object[constructor.getParameterCount()];
for (int i = params.length - 1 ; i >= 0 ; i--) {
params[i] = fromISBPL(stack.pop());