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
When calling new Date() with a stringified date that contains '00', instead of throwing me an error it converts it to a previous date.
I have run gradle clean and confirmed this bug does not occur with JSC
Hermes version: 0.12
React Native version (if any): 0.71.13
OS version (if any): 16.4
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64
Steps To Reproduce
Call new Date() with a date that contains a '00' in the string. Ex new Date('1999-00-00')
code example:
The Expected Behavior
Should throw an 'Invalid Date' error
Actual Behavior
Returns 1998-11-30T00:00:00.000Z (as shown in the screenshot)
The text was updated successfully, but these errors were encountered:
Thank you for reporting this, the behaviour here is interesting, especially as we look at going in the other direction. For instance, both Hermes and V8 will accept new Date('1999-02-31'), whereas JSC and SM will not.
It would be relatively simple to add the kind of basic validation V8 seems to be doing (and the spec seems to require it), but matching JSC and SM will likely be more involved.
Bug Description
When calling new Date() with a stringified date that contains '00', instead of throwing me an error it converts it to a previous date.
gradle clean
and confirmed this bug does not occur with JSCHermes version: 0.12
React Native version (if any): 0.71.13
OS version (if any): 16.4
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64
Steps To Reproduce
new Date()
with a date that contains a '00' in the string. Ex new Date('1999-00-00')code example:
The Expected Behavior
Should throw an 'Invalid Date' error
Actual Behavior
Returns 1998-11-30T00:00:00.000Z (as shown in the screenshot)
The text was updated successfully, but these errors were encountered: