Closed Bug 1866811 Opened 2 years ago Closed 2 years ago

the javascript-engine returns 943916400000 on Date.parse("0000-00-00") instead of NaN

Categories

(Core :: JavaScript Engine, defect, P1)

Firefox 120
defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
thunderbird_esr115 --- unaffected
firefox-esr115 --- unaffected
firefox120 --- wontfix
firefox121 --- fixed
firefox122 --- fixed

People

(Reporter: m.sekora.ca, Assigned: vinny.diehl)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0

Steps to reproduce:

run Date.parse("0000-00-00") in the Javascript-Console

Actual results:

943916400000

Expected results:

NaN

Component: Untriaged → JavaScript Engine
Flags: needinfo?(vinny.diehl)
Product: Firefox → Core
Assignee: nobody → vinny.diehl
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Thanks for the referral, Tom! TryParseDashedNumericDatePrefix needed to be tightened up a little bit, I have a patch up.

Flags: needinfo?(vinny.diehl)
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/35576b9194fb Reject numeric dates with 0 for mon or mday r=arai
Severity: -- → S3
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch

FF120 + 121 affected

The patch landed in nightly and beta is affected.
:vinny.diehl, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox121 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(vinny.diehl)

Do you think we should uplift this? Asking because of priority set, and because this format YYYY-mm-dd is similar to spec format. Not sure if any websites might rely on this being NaN.

Flags: needinfo?(vinny.diehl) → needinfo?(arai.unmht)

So, this is a kind of regression from bug 1557650.
I think beta uplift makes sense.

Flags: needinfo?(arai.unmht)
Keywords: regression
Regressed by: 1557650
Flags: needinfo?(vinny.diehl)
Attachment #9366399 - Flags: approval-mozilla-beta?

Uplift Approval Request

  • String changes made/needed: None
  • Needs manual QE test: no
  • Risk associated with taking this patch: Low
  • Fix verified in Nightly: yes
  • User impact if declined: Regression affecting date parsing of invalid ISO-like format which is rejected by other browsers
  • Explanation of risk level: Small change in well-tested code
  • Steps to reproduce for manual QE testing: Date.parse("0000-00-00") should be NaN
  • Code covered by automated testing: yes
  • Is Android affected?: yes
Flags: needinfo?(vinny.diehl)

Comment on attachment 9366399 [details]
Bug 1866811 - Reject numeric dates with 0 for mon or mday

Approved for 121.0b6.

Attachment #9366399 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: in-testsuite+
Duplicate of this bug: 1868577
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: