Remove deprecated for-each-in loop and let blocks and fix strict mode warnings in toolkit/mozapps/downloads

RESOLVED FIXED in mozilla37

Status

()

Toolkit
Downloads API
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

unspecified
mozilla37
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

3 years ago
Created attachment 8532876 [details] [diff] [review]
fix-downloads-js.patch

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

3 years ago
Created attachment 8532877 [details] [diff] [review]
fix-webapprt-downloads.patch

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 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+
Attachment #8532877 - Flags: review?(paolo.mozmail) → review+
(Assignee)

Comment 3

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/f12d02a53b0a
https://hg.mozilla.org/integration/mozilla-inbound/rev/824d26fdcb28
https://hg.mozilla.org/mozilla-central/rev/f12d02a53b0a
https://hg.mozilla.org/mozilla-central/rev/824d26fdcb28
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
This patch caused a regression in webapprt downloads, the patch in bug 1116769 fixes it.
(By partially backing out this patch)
(Assignee)

Comment 7

3 years ago
Marco's backout:

https://hg.mozilla.org/integration/mozilla-inbound/rev/99dfdc6bdee8
(Assignee)

Updated

3 years ago
Depends on: 1116769
(Assignee)

Updated

3 years ago
Blocks: 1167029
You need to log in before you can comment on or make changes to this bug.