JavaScript converted in Java. There're still regexp and types problems to convert.