That was fast Jaguar. But tell me: with what data type did you replace the Java long type?
I'm still thinking through that. Right now, I've found two possibilities.
-
http://jsfromhell.com/classes/bignumber - nice because it would allow us to get rid of the long10 stuff.
-
http://docs.closure-library.googlecode.com/git/class_goog_math_Long.html - will allow the code to stay more similar to the original code
I'm leaning towards the second until everything is working and then maybe switching to the first because it would allow us to remove some of the extra long stuff, but I still need to evaluate how intrusive the changes are. If they're equally intrusive, it might make sense sense to just use the first one from the beginning.
Jaguar0625
I ran js.core & java.core for a same hash key - the result is different.
You can use java ScriptEngine for mix java & javascript code for testing.
Thanks. I suspect there are still a few bugs that need to be investigated.
To be a little more transparent with my process, when I'm doing a bulk conversion of code from one language to another, I like to do it in phases:
(1) Do a bulk conversion so that there the code doesn't have any compiler errors in the new language
(1a) Build a test harness (it should almost certainly fail at this point)
(2) Make more significant changes (e.g. convert JavaScript to use correctly operate on 64-bit values) in a phased approach (so that each major change is a separate check-in)
(3) Bug fix / diff source and target code a lot
(4) If necessary, improve performance refactor.
Right now all I've done is phase 1. There's still a good amount of work remaining, but at least a decent groundwork has been laid.