Skip to content Skip to sidebar Skip to footer

Java 8/javascript (nashorn) Long Interoperatiblity

The following Javascript code executed in Java 8 (Nashorn) does not behave as expected : if( a != b ) { do_sth(); } a and b are long values coming from Java object (e.g., 102394

Solution 1:

I guess Nashorn passes the long values as JS objects to the JS side and thus the comparison returns wrong even though the values are same.

You can check with typeofa and b on JS side.

Post a Comment for "Java 8/javascript (nashorn) Long Interoperatiblity"