Closed
Bug 1083467
Opened 10 years ago
Closed 10 years ago
Add console warnings for E4X for-each
Categories
(Core :: JavaScript Engine, defect, P4)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
(deleted),
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
Console warning should point readers to MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
Assignee | ||
Comment 1•10 years ago
|
||
Log console warnings for JavaScript 1.6's deprecated for-each-in loops. As seen in Beta 34 telemetry, fewer than 250 for-each-in loops were reported web content (though for-each-in loops are popular in Firefox chrome code):
http://telemetry.mozilla.org/#filter=beta%2F34%2FJS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT&aggregates=multiselect-all!Submissions&evoOver=Time&locked=true&sanitize=true&renderhistogram=Table
1. This patch logs the same warning for JavaScript 1.6's for-each-in loops and JavaScript 1.7's for-each-in array comprehensions. The preferred fix for these legacy array comprehensions is to use ES7 array comprehensions or something like Array.map(). Is it counterproductive to warn developers about for-each-in in legacy array comprehensions instead of telling them to not use legacy array comprehensions?
2. To reduce console noise, this patch only warns for JS code that is *not* JSVERSION_LATEST (i.e. JS 1.8.5, the default chrome JS version). I have only found a few instances of Firefox code using for-each-in with JS version 1.7 or 1.8. Later we can restrict for-each-in to just chrome JS.
Updated•10 years ago
|
Attachment #8528885 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7d0b5801159a
https://hg.mozilla.org/mozilla-central/rev/7a3e8ce41a29
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Comment 4•10 years ago
|
||
Added to the compat doc: https://developer.mozilla.org/en-US/Firefox/Releases/37/Site_Compatibility
Keywords: dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•