Closed
Bug 1108310
Opened 10 years ago
Closed 10 years ago
Remove deprecated for-each-in loop and let blocks and fix strict mode warnings in toolkit/mozapps/downloads
Categories
(Toolkit :: Downloads API, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(2 files)
|
11.16 KB,
patch
|
Unfocused
:
review+
|
Details | Diff | Splinter Review |
|
7.73 KB,
patch
|
Unfocused
:
review+
|
Details | Diff | Splinter Review |
1. for-each-in loops and let blocks are a nonstandard JS features of SpiderMonkey and should be removed:
> toolkit/mozapps/downloads/content/downloads.js:414: let (sb = document.getElementById("downloadStrings")) {
> toolkit/mozapps/downloads/content/downloads.js:976: let (stateSize = {}) {
> toolkit/mozapps/downloads/content/downloads.js:1113: let (empty = gDownloadsView.cloneNode(false)) {
> toolkit/mozapps/downloads/content/downloads.js:1175: let (referrer = gStmt.getString(7)) {
2. Add "use strict" and fix strict mode warnings:
> JavaScript strict warning: resource://gre/modules/DownloadUtils.jsm, line 79: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated
> JavaScript warning: resource://gre/modules/DownloadUtils.jsm, line 273: JavaScript 1.7's let blocks are deprecated
Attachment #8532876 -
Flags: review?(paolo.mozmail)
| Assignee | ||
Comment 1•10 years ago
|
||
Part 2: Remove deprecated for-each-in loop and let blocks and fix strict mode warnings in webapprt/content/downloads/downloads
> webapprt/content/downloads/downloads.js:357: let (stateSize = {}) {
> webapprt/content/downloads/downloads.js:724: let (empty = this.downloadView.cloneNode(false)) {
> webapprt/content/downloads/downloads.js:1112: let (sb = document.getElementById("downloadStrings")) {
Attachment #8532877 -
Flags: review?(paolo.mozmail)
Comment 2•10 years ago
|
||
Comment on attachment 8532876 [details] [diff] [review]
fix-downloads-js.patch
Review of attachment 8532876 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/mozapps/downloads/DownloadUtils.jsm
@@ +277,4 @@
>
> // If the new time is similar, reuse something close to the last seconds,
> // but subtract a little to provide forward progress
> + diff = aSeconds - aLastSec;
Can just remove this line now.
Attachment #8532876 -
Flags: review?(paolo.mozmail) → review+
Updated•10 years ago
|
Attachment #8532877 -
Flags: review?(paolo.mozmail) → review+
| Assignee | ||
Comment 3•10 years ago
|
||
Comment 4•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f12d02a53b0a
https://hg.mozilla.org/mozilla-central/rev/824d26fdcb28
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Comment 5•10 years ago
|
||
This patch caused a regression in webapprt downloads, the patch in bug 1116769 fixes it.
Comment 6•10 years ago
|
||
(By partially backing out this patch)
| Assignee | ||
Comment 7•10 years ago
|
||
Marco's backout:
https://hg.mozilla.org/integration/mozilla-inbound/rev/99dfdc6bdee8
You need to log in
before you can comment on or make changes to this bug.
Description
•