You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application that runs JS code dynamically using Nashorn on Java 8. I'm migrating to GraalJS, but it seems that when you return 1.0 from JS, Nashorn returns Double 1.0, while GraalJS returns Integer 1.
Note that there is no difference between 1 and 1.0 in JavaScript. It is the same value. It is an implementation detail of Nashorn that it returns Integer in one case and Double in another. We are not going to mimic this detail. I suggest you not to depend on the exact type (in either JavaScript engine).
I have an application that runs JS code dynamically using Nashorn on Java 8. I'm migrating to GraalJS, but it seems that when you return
1.0
from JS, Nashorn returns Double1.0
, while GraalJS returns Integer1
.Example Nashorn:
Example GraalJS:
pom.xml:
The text was updated successfully, but these errors were encountered: