Closed artem-frolov closed 8 years ago
Hi there. JSweet it not ready yet for factorizing behavior between Java and JavaScript. What you can do in the meantime is to have a Java implementation in a method annotated with @Erased
(so that it is ignored by the JSweet transpiler), and a JS implementation in another method (which you call from the JavaScript part of the program).
Hi. It would be simple to just transpile String.equals to == (@artem-frolov, maybe you should PR this) but there is a larger reflexion to have between ==, hashCode, equals and how to make it work properly in both JS & Java worlds.
This may be the good place to discuss it :)
Thanks for your participation
With version 1.1.0 and J4TS, JSweet is now Java-friendly :)
I use jsweet for a code that should work in Java and in Javascript. So I can't use jsweet.lang - such code can not be compiled in Java. It would be great to have
java.lang.String.equals
method implemented to make strings comparison easier.