Closed
Bug 1105406
Opened 10 years ago
Closed 10 years ago
Remove deprecated for-each-in array comprehension in about:newtab
Categories
(Firefox :: New Tab Page, defect)
Firefox
New Tab Page
Tracking
()
RESOLVED
FIXED
Firefox 37
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
1.01 KB,
patch
|
adw
:
review+
|
Details | Diff | Splinter Review |
Bug 1083467 will log console warnings for JavaScript 1.6's deprecated for-each-in loops (including JavaScript 1.7's legacy for-each-in array comprehensions). This patch replaces a for-each-in array comprehension in about:newtab code with an ES7 for-of array comprehension.
This patch also initializes _cells to [] instead of null. for-each-in array comprehensions handle null by returning [], but for-of throws a TypeError on null.
Attachment #8529177 -
Flags: review?(adw)
Comment 1•10 years ago
|
||
Comment on attachment 8529177 [details] [diff] [review]
1083467_fix-newtab.patch
Review of attachment 8529177 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks.
I wondered whether anything depends on _cells starting out as null, but a search on mxr doesn't reveal anything, not even in tests. All consumers expect cells to be an array. So that part of this patch looks OK.
[for (cell of this.cells || []) cell.site] would be the safest thing to do since it wouldn't change the current behavior at all, but given what I just said about consumers, plus my opinion that it makes sense anyway for _cells to always be an array, I don't think that's necessary.
Attachment #8529177 -
Flags: review?(adw) → review+
Assignee | ||
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
Assignee: nobody → cpeterson
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Can I pick up this bug for QA? If so, can someone update the QA steps?
You need to log in
before you can comment on or make changes to this bug.
Description
•