Closed chefhoobajoob closed 2 years ago
In the polyfill we're coercing the argument to number with Number(value)
which can return NaN
. We should either use the function isNaN()
or do an extra verification against x !== x
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN
Do not confuse with Number.isNaN()
Some js libraries making use of the setTimer function on es4x are sometimes generating exceptions with this message:
invokeMember (setTimer) on io.vertx.core.impl.VertxImpl@2c930868 failed due to: Cannot convert 'NaN'(language: Java, type: java.lang.Double) to Java type 'long': Invalid or lossy primitive coercion
Looks like there might be a type handling issue in the es4x implementation