Closed Bug 802750 Opened 12 years ago Closed 9 months ago

Date.parse accepts "-000000" year in extended ISO-8601 format

Categories

(Core :: JavaScript: Standard Library, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1769088

People

(Reporter: anba, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
Build ID: 20121010144125

Steps to reproduce:

js> Date.parse("-000000-01-01T00:00:00.000Z") 



Actual results:

Date.parse() returns the number `-62167219200000`


Expected results:

Date.parse() should return `NaN`, cf. ES5.1 [15.9.1.15.1  Extended years]:
---
[...] The year 0  is considered positive and hence prefixed with a + sign.
---
OS: Windows 7 → All
Hardware: x86_64 → All
Assignee: general → nobody
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → JavaScript: Standard Library
Ever confirmed: true
Assignee: nobody → eric

The ECMAScript spec allows for expanded years for representing the full
range of allowed dates. Extended dates are represented with a year part
consisting of 6 digits prefixed with a + or - sign. The year 000000 is
only allowed to be prefixed with a + sign.

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: eric → nobody
Severity: normal → S3

This was fixed in bug 1769088.

Status: NEW → RESOLVED
Closed: 9 months ago
Duplicate of bug: 1769088
Resolution: --- → DUPLICATE
Assignee: nobody → eric
Assignee: eric → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: