-
Notifications
You must be signed in to change notification settings - Fork 160
Home
Welcome to the JSweet wiki!
Current target: 1.2.0 (filter the issues on 1.2.0 milestone).
Current mixins are not standard and too complicated to use in a regular Java environment (they require a plugin or a specific classpath configuration). We need to make mixins easier. Something like:
public class MyClass extends jsweet.lang.Object { }
@Mixin
public class MyMixin extends MyClass {
public void addedMethod();
public String addedProperty
}
Usage:
MyClass o = ...;
o.$mixin(MyMixin.class).addedMethod();
Add/change the following utility methods:
- jsweet.lang.Object $get(String key)
- String $getString(String key)
- boolean $getBoolean(String key)
- double $getNumber(String key)
- Object $getObject(String key)
- jsweet.lang.Object $apply(Object... args)
- String $applyForString(Object... args)
- boolean $applyForBoolean(Object... args)
- double $applyForNumber(Object... args)
- Object $applyForObject(Object... args)
Change the current convention of apply()
as $apply
Remove the jsweet.util.Globals.$apply()
, jsweet.util.Globals.$get()
, jsweet.util.Globals.$set()
utility methods (should use the new Object API instead).
Rename jsweet.util.Globals.object()
to jsweet.util.Globals.$object()
for consistency reason and avoid clashes with local variables. Same for string
, number
utility methods?
jsweet.dom
-> def.dom
jsweet.lang
-> def.js
We then need to be able to declare the "system" packages to handle special cases (could be a transpiler option or an annotation on the package).