Coercion of Enums in Nashorn works differently than in Rhino

主宰稳场 提交于 2019-12-10 17:34:32

问题


It seems that Java enums are no longer coerced into their string value:

java.math.RoundingMode.UP == "UP"

evaluates to true in Java 7 but to false in Java 8 when executed in the JavaScript engine.

Does anybody know if this is actually a bug or just something in the specification?

Thanks!


回答1:


This is a bug: https://bugs.openjdk.java.net/browse/JDK-8072426 .....................................................................



来源:https://stackoverflow.com/questions/28152990/coercion-of-enums-in-nashorn-works-differently-than-in-rhino

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!