ClassJS v0.1-alpha.4
Pre-release
Pre-release
·
10 commits
to 1.20.1
since this release
New Features
-
ClassJSUtils.loadClass- Allows to load a class that was created by
ClassCreator.
let TestClass = ClassCreator.create("TestClass") .toPublic() .defaultConstructor() .defineClass(); let loaded = ClassJSUtils.loadClass("TestClass"); console.info(loaded === TestClass); // true
- Allows to load a class that was created by
-
MethodCreator.codeJSWithThis- Allows to define a method where the first parameter is
this.
let TestClass = ClassCreator.create("TestClass") .toPublic() .defaultConstructor() .createField("testField", "int") .toPublic() .build() .createMethod("testMethod", ["java.lang.String", "int"], "void") .toPublic() .codeJSWithThis((thisObj, s, r) => { // Now, `thisObj` represents the instance of TestClass console.info(s + 's'.repeat(r)); thisObj.testField = r; }) .defineClass();
- Allows to define a method where the first parameter is
Fixed Bugs
- Reloading methods written in
invokeJSthat are never used causedNullPointerException. - Specifying a method's parameter types or its return type as the currently defining class caused
TypeNotPresentException.