Closed Bug 1129336 Opened 10 years ago Closed 10 years ago

Remove nonstandard let blocks from testing/xpcshell

Categories

(Testing :: XPCShell Harness, defect)

x86
macOS
defect
Not set
normal

Tracking

(firefox38 fixed)

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch testing-xpcshell.patch (obsolete) — Splinter Review
let blocks are a nonstandard SpiderMonkey feature we would like to remove (in bug 1023609). This patch removes the let blocks in the testing/ subtree. The attached patch excludes whitespace changes because most of the patch is unindenting blocks of unchanged code from the removed let blocks. This made the important bits of the patch harder to review.
Attachment #8558998 - Flags: review?(cmanchester)
Comment on attachment 8558998 [details] [diff] [review] testing-xpcshell.patch Review of attachment 8558998 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/xpcshell/head.js @@ +52,5 @@ > // not connected to a network. > +let ios2 = Components.classes["@mozilla.org/network/io-service;1"] > + .getService(Components.interfaces.nsIIOService2); > +ios2.manageOfflineStatus = false; > +ios2.offline = false; Top level declarations in xpcshell/head.js are exposed to every test file, so if nonstandard let blocks work the way I expect, this introduces a new variable we'd probably rather keep hidden.
(In reply to Chris Manchester [:chmanchester] from comment #1) > Top level declarations in xpcshell/head.js are exposed to every test file, > so if nonstandard let blocks work the way I expect, this introduces a new > variable we'd probably rather keep hidden. OK. I can change this code to hide the ios variable in a no-op {} block or an IIFE.
(In reply to Chris Peterson [:cpeterson] from comment #2) > (In reply to Chris Manchester [:chmanchester] from comment #1) > > Top level declarations in xpcshell/head.js are exposed to every test file, > > so if nonstandard let blocks work the way I expect, this introduces a new > > variable we'd probably rather keep hidden. > > OK. I can change this code to hide the ios variable in a no-op {} block or > an IIFE. A no-op {} block would be ok with me!
Patch v2: unfold the `let (ios = ...)` let block into a no-op {} block instead of renaming `ios` to `ios2`.
Attachment #8558998 - Attachment is obsolete: true
Attachment #8558998 - Flags: review?(cmanchester)
Attachment #8559643 - Flags: review?(cmanchester)
Attachment #8559643 - Flags: review?(cmanchester) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Blocks: 1167029
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: