Add JIO getclass

This commit is contained in:
Daniella / Tove 2022-04-16 21:05:17 +02:00
parent 6d29b9d8d4
commit 8b55f0921f
2 changed files with 17 additions and 0 deletions

View file

@ -892,6 +892,18 @@ public class ISBPL {
}
};
break;
case "jio.getclass":
func = (stack) -> {
ISBPLObject str = stack.pop();
String s = toJavaString(str);
try {
stack.push(toISBPL((Object) Class.forName(s)));
}
catch (ClassNotFoundException e) {
throw new ISBPLError("JIO", "Class not found");
}
};
break;
default:
func = natives.get(name);
break;

View file

@ -92,6 +92,11 @@ def TYPE_JIO "jio" mktype =TYPE_JIO
native jio.class
jio.class
} TYPE_JIO defmethod
"getclass" {
pop
native jio.getclass
jio.getclass
} TYPE_JIO defmethod
def JIO 0 TYPE_JIO settype =JIO
def TYPE_STRING "string" mktype =TYPE_STRING