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
getUTCDate = 31
getUTCMonth = 11
getUTCFullYear = 1899
number
0
-Infinity
uncaught exception: scala.scalajs.runtime.UndefinedBehaviorError: An undefined behavior was detected: 0 is not an instance of java.lang.Integer
The text was updated successfully, but these errors were encountered:
So whether Firefox is allowed to return -0 in some cases is pretty irrelevant at this point. All the methods must clearly marked as returning Doubles.
Also, it's OK to call one of the setX method with NaN, in which case the date will be set to an invalid date, and therefore all methods will return NaN after that.
sjrd
changed the title
On Firefox, (some) js.Date functions can return -0, which cause CCEs
js.Date functions can return NaN, so they should be typed as Double
Apr 1, 2018
For invalid dates, created from a string that cannot be parsed, the
methods of `js.Date` return `NaN`. Therefore, they must be typed as
`Double`s. By extension, this covers up for Firefox returning -0
for some valid date as well, instead of +0 like everyone else.
In the process, we fix the behavior of `j.u.Date.parse` for invalid
inputs.
Was: On Firefox, (some) js.Date functions can return -0, which cause CCEs
Reproducible with
testSuite/testHtmlFastOpt
with Firefox. Also:gives:
The text was updated successfully, but these errors were encountered: