cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 160 forks source link

Add support for java.lang.String.length() #26

Closed dasa closed 8 years ago

dasa commented 8 years ago

The Java String's length method should be transpiled to the JS length property.

renaudpawlak commented 8 years ago

Yes, I agree on this one for convenience... I was annoyed by this behavior lately. Right now the workaround is:

import static jsweet.util.Globals.string; [...] string(myString).length;

Not very nice for sure, so I will add the support for version 1 RC1.

renaudpawlak commented 8 years ago

This should now work with the new jsweet-transpiler SNAPSHOT.

renaudpawlak commented 8 years ago

I am closing the issue. Tell me if it does not work.

dasa commented 8 years ago

It's working good! Thanks :+1: