I am just trying to understand why several of the methods in the Js class do not have the @DoNotAutobox annotation on their object parameters when presumably they should. Examples include the "as" methods and supporting infrastructure. i.e. Js.asBoolean(obj) and thus InternalJsUtil.asBoolean(obj), as well as Js.coerceToDouble(obj).
Is it just because it is assumed that humans invoking this are smart enough to not misuse them and the code is unlikely to be used in code generators? What would be the penalty of adding them?
I am just trying to understand why several of the methods in the
Js
class do not have the@DoNotAutobox
annotation on their object parameters when presumably they should. Examples include the "as" methods and supporting infrastructure. i.e.Js.asBoolean(obj)
and thusInternalJsUtil.asBoolean(obj)
, as well asJs.coerceToDouble(obj)
.Is it just because it is assumed that humans invoking this are smart enough to not misuse them and the code is unlikely to be used in code generators? What would be the penalty of adding them?