Closed
Bug 1022254
Opened 10 years ago
Closed 10 years ago
JS Date with integer literals with leading zeroes is broken due to bug 957513
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
Tracking | Status | |
---|---|---|
firefox31 | --- | unaffected |
firefox32 | --- | unaffected |
firefox33 | - | unaffected |
firefox34 | - | unaffected |
People
(Reporter: anshprat, Unassigned)
References
Details
(Keywords: regression, site-compat)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0 (Beta/Release)
Build ID: 20140607030208
Steps to reproduce:
Sites having date in JS are broken:
in console, enter -
date = new Date(2013,08,12);
Actual results:
The respective JS is broken
X SyntaxError: numbers starting with 0 followed by a digit are octals and can't contain 8
Expected results:
respective JS should be parsed and the site should work.
Reporter | ||
Updated•10 years ago
|
Summary: Date is broken due to 957513 → JS Date is broken due to 957513
Updated•10 years ago
|
Component: Untriaged → JavaScript Engine
Keywords: site-compat
OS: Mac OS X → All
Product: Firefox → Core
Hardware: x86 → All
Updated•10 years ago
|
Comment 1•10 years ago
|
||
Sounds to me like the spec is not web-compatible here and needs to change.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•10 years ago
|
||
I'm not sure the reported case is common. The result of new Date(2013,08,12) may not what the author expected; It's actually 2013-09-12 since the month is an integer beginning with 0 for January to 11 for December. So developers usually have to +1 in their code, then the value won't be zero-prefixed.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
Reporter | ||
Comment 3•10 years ago
|
||
Mm, the handling of +1 could be managed on server side as well I guess?
Comment 4•10 years ago
|
||
Till backed out bug 957513 from Aurora 32, but let's track this for 33. If we can't get this bug fixed soon, we may need to back bug 957513 out of 33, too.
status-firefox31:
--- → unaffected
status-firefox32:
--- → wontfix
status-firefox33:
--- → affected
tracking-firefox33:
--- → ?
Comment 5•10 years ago
|
||
Jason: does this Date bug suggest that we can never enable the octal syntax errors?
IIUC, bz asserts in comment 1 that the ES6 spec's octal syntax error is not web-compatible, but I agree with Kohei in comment 2 that these syntax errors are reporting likely content bugs. Should we downgrade the syntax errors to console warnings for the indefinite future?
Flags: needinfo?(jorendorff)
Summary: JS Date is broken due to 957513 → JS Date is broken due to bug 957513
Comment 6•10 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #5)
> Jason: does this Date bug suggest that we can never enable the octal syntax
> errors?
Yes.
> IIUC, bz asserts in comment 1 that the ES6 spec's octal syntax error is not
> web-compatible, but I agree with Kohei in comment 2 that these syntax errors
> are reporting likely content bugs.
Sure. Suppose both are true. Then we can never enable the octal syntax errors.
As a wise man once told me: Don't break the web.
> Should we downgrade the syntax errors to
> console warnings for the indefinite future?
Yep.
Flags: needinfo?(jorendorff)
This also broke the KU Leuven exam schedule in Nightly. Error happens here: |new Date(2014,00,10,08,30)|
Updated•10 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Updated•10 years ago
|
status-firefox34:
--- → affected
tracking-firefox34:
--- → +
Updated•10 years ago
|
Comment 11•10 years ago
|
||
Can we downgrade the error to warning instead of removing the functionality altogether?
Comment 12•10 years ago
|
||
(In reply to Simonas Kazlauskas [:simukis] from comment #11)
> Can we downgrade the error to warning instead of removing the functionality
> altogether?
Please ignore. I did not look at bug 957513 hard enough before writing here.
Comment 14•10 years ago
|
||
Bug 957513 was backed out fully and closed as WONTFIX. Closing this.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(jorendorff)
Resolution: --- → FIXED
Summary: JS Date is broken due to bug 957513 → JS Date with integer literals with leading zeroes is broken due to bug 957513
Updated•10 years ago
|
Target Milestone: --- → mozilla34
Updated•10 years ago
|
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
You need to log in
before you can comment on or make changes to this bug.
Description
•