forked from mirrors/gecko-dev
Bug 1309842 - Fix eslint/espree parsing errors for ignored directories in browser/. r=jaws
Change functions definitions to generators where yield is used, and drop of non-standards if statement in catch. List translation/cld2/cld-worker.js as ignored now, as it is a generated file. MozReview-Commit-ID: wbkjx67fox --HG-- extra : rebase_source : 80a5171b75b314ce81a0d87cdce6ec7ab5443075
This commit is contained in:
parent
55181540ae
commit
975effef47
3 changed files with 12 additions and 8 deletions
|
|
@ -69,6 +69,8 @@ browser/components/privatebrowsing/**
|
|||
browser/components/sessionstore/**
|
||||
browser/components/tabview/**
|
||||
browser/components/translation/**
|
||||
# generated files in cld2
|
||||
browser/components/translation/cld2/cld-worker.js
|
||||
browser/extensions/pdfjs/**
|
||||
# generated or library files in pocket
|
||||
browser/extensions/pocket/content/panels/js/tmpl.js
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ function promisePanelOpened()
|
|||
return deferred.promise;
|
||||
}
|
||||
|
||||
function task_resetState()
|
||||
function* task_resetState()
|
||||
{
|
||||
// Remove all downloads.
|
||||
let publicList = yield Downloads.getList(Downloads.PUBLIC);
|
||||
|
|
@ -185,7 +185,7 @@ function* task_addDownloads(aItems)
|
|||
}
|
||||
}
|
||||
|
||||
function task_openPanel()
|
||||
function* task_openPanel()
|
||||
{
|
||||
yield promiseFocus();
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ function task_openPanel()
|
|||
yield promise;
|
||||
}
|
||||
|
||||
function setDownloadDir() {
|
||||
function* setDownloadDir() {
|
||||
let tmpDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
|
||||
tmpDir.append("testsavedir");
|
||||
if (!tmpDir.exists()) {
|
||||
|
|
|
|||
|
|
@ -273,9 +273,11 @@ var promiseForEachSessionRestoreFile = Task.async(function*(cb) {
|
|||
let data = "";
|
||||
try {
|
||||
data = yield OS.File.read(SessionFile.Paths[key], { encoding: "utf-8" });
|
||||
} catch (ex if ex instanceof OS.File.Error
|
||||
&& ex.becauseNoSuchFile) {
|
||||
} catch (ex) {
|
||||
// Ignore missing files
|
||||
if (!(ex instanceof OS.File.Error && ex.becauseNoSuchFile)) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
cb(data, key);
|
||||
}
|
||||
|
|
@ -302,7 +304,7 @@ function r() {
|
|||
return Date.now() + "-" + (++gUniqueCounter);
|
||||
}
|
||||
|
||||
function BrowserWindowIterator() {
|
||||
function* BrowserWindowIterator() {
|
||||
let windowsEnum = Services.wm.getEnumerator("navigator:browser");
|
||||
while (windowsEnum.hasMoreElements()) {
|
||||
let currentWindow = windowsEnum.getNext();
|
||||
|
|
@ -372,7 +374,7 @@ var gProgressListener = {
|
|||
_countTabs: function () {
|
||||
let needsRestore = 0, isRestoring = 0, wasRestored = 0;
|
||||
|
||||
for (let win in BrowserWindowIterator()) {
|
||||
for (let win of BrowserWindowIterator()) {
|
||||
for (let i = 0; i < win.gBrowser.tabs.length; i++) {
|
||||
let browser = win.gBrowser.tabs[i].linkedBrowser;
|
||||
if (!browser.__SS_restoreState)
|
||||
|
|
@ -394,7 +396,7 @@ registerCleanupFunction(function () {
|
|||
// Close all but our primary window.
|
||||
function promiseAllButPrimaryWindowClosed() {
|
||||
let windows = [];
|
||||
for (let win in BrowserWindowIterator()) {
|
||||
for (let win of BrowserWindowIterator()) {
|
||||
if (win != window) {
|
||||
windows.push(win);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue