зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1425047 - Enable rest of ESLint rules for mobile/android. r=esawin
This enables consistent-return, no-empty and no-redeclare. Differential Revision: https://phabricator.services.mozilla.com/D60827 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c7825a859e
Коммит
b6a7518552
|
@ -1,14 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
rules: {
|
|
||||||
// Rules enabled in mozilla/recommended, and disabled for now, we should
|
|
||||||
// re-enable these over time.
|
|
||||||
"consistent-return": "off",
|
|
||||||
"no-empty": "off",
|
|
||||||
"no-redeclare": "off",
|
|
||||||
},
|
|
||||||
|
|
||||||
"overrides": [{
|
"overrides": [{
|
||||||
files: [
|
files: [
|
||||||
// Bug 1425048 - mainly going away, see bug 1583370.
|
// Bug 1425048 - mainly going away, see bug 1583370.
|
||||||
|
|
|
@ -51,7 +51,7 @@ class LoadURIDelegateChild extends GeckoViewActorChild {
|
||||||
if (!this.isContentWindow) {
|
if (!this.isContentWindow) {
|
||||||
debug`loadURI: not a content window`;
|
debug`loadURI: not a content window`;
|
||||||
// This is an internal Gecko window, nothing to do
|
// This is an internal Gecko window, nothing to do
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LoadURIDelegate.load(
|
return LoadURIDelegate.load(
|
||||||
|
@ -72,7 +72,7 @@ class LoadURIDelegateChild extends GeckoViewActorChild {
|
||||||
if (!this.isContentWindow) {
|
if (!this.isContentWindow) {
|
||||||
// This is an internal Gecko window, nothing to do
|
// This is an internal Gecko window, nothing to do
|
||||||
debug`handleLoadError: not a content window`;
|
debug`handleLoadError: not a content window`;
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aUri && LoadURIDelegate.isSafeBrowsingError(aError)) {
|
if (aUri && LoadURIDelegate.isSafeBrowsingError(aError)) {
|
||||||
|
|
|
@ -14,7 +14,6 @@ ChromeUtils.defineModuleGetter(
|
||||||
"resource://gre/modules/GeckoViewTab.jsm"
|
"resource://gre/modules/GeckoViewTab.jsm"
|
||||||
);
|
);
|
||||||
|
|
||||||
/* globals EventDispatcher */
|
|
||||||
var { EventDispatcher } = ChromeUtils.import(
|
var { EventDispatcher } = ChromeUtils.import(
|
||||||
"resource://gre/modules/Messaging.jsm"
|
"resource://gre/modules/Messaging.jsm"
|
||||||
);
|
);
|
||||||
|
|
|
@ -116,7 +116,7 @@ GeckoViewPermission.prototype = {
|
||||||
})
|
})
|
||||||
.then(devices => {
|
.then(devices => {
|
||||||
if (win.closed) {
|
if (win.closed) {
|
||||||
return;
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
let sources = devices.map(device => {
|
let sources = devices.map(device => {
|
||||||
|
|
|
@ -484,7 +484,7 @@ PromptDelegate.prototype = {
|
||||||
_showPrompt(aMsg) {
|
_showPrompt(aMsg) {
|
||||||
let result = undefined;
|
let result = undefined;
|
||||||
if (!this._domWin || !this._changeModalState(/* aEntering */ true)) {
|
if (!this._domWin || !this._changeModalState(/* aEntering */ true)) {
|
||||||
return;
|
return result;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.asyncShowPrompt(aMsg, res => (result = res));
|
this.asyncShowPrompt(aMsg, res => (result = res));
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
<script>
|
<script>
|
||||||
var start = new Date().getTime();
|
var start = new Date().getTime();
|
||||||
document.getElementById("content").innerHTML = "Started";
|
document.getElementById("content").innerHTML = "Started";
|
||||||
|
// eslint-disable-next-line no-empty
|
||||||
while((new Date().getTime() - start) < 5000 ) {};
|
while((new Date().getTime() - start) < 5000 ) {};
|
||||||
document.getElementById("content").innerHTML = "Finished";
|
document.getElementById("content").innerHTML = "Finished";
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -81,6 +81,8 @@ const GeckoViewRecordingMedia = {
|
||||||
return STATUS_RECORDING;
|
return STATUS_RECORDING;
|
||||||
case MediaManagerService.STATE_NOCAPTURE:
|
case MediaManagerService.STATE_NOCAPTURE:
|
||||||
return STATUS_INACTIVE;
|
return STATUS_INACTIVE;
|
||||||
|
default:
|
||||||
|
throw new Error("Unexpected activityStatus value");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -482,7 +482,7 @@ var GeckoViewUtils = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return aLogger[aLevel.toLowerCase()](strs, ...aExprs);
|
aLogger[aLevel.toLowerCase()](strs, ...aExprs);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,6 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
|
||||||
/* globals AndroidLog */
|
|
||||||
|
|
||||||
const TAG = "AndroidLogTest";
|
const TAG = "AndroidLogTest";
|
||||||
|
|
||||||
const VERBOSE_MESSAGE = "This is a verbose message.";
|
const VERBOSE_MESSAGE = "This is a verbose message.";
|
||||||
|
|
|
@ -12,9 +12,9 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
|
||||||
const {Promise} = ChromeUtils.import("resource://gre/modules/Promise.jsm"); /* global Promise */
|
const {Promise} = ChromeUtils.import("resource://gre/modules/Promise.jsm");
|
||||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); /* global Services */
|
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); /* global NetUtil */
|
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||||
|
|
||||||
function readChannel(url) {
|
function readChannel(url) {
|
||||||
let deferred = Promise.defer();
|
let deferred = Promise.defer();
|
||||||
|
|
|
@ -14,8 +14,6 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* globals SimpleServiceDiscovery */
|
|
||||||
|
|
||||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
const {SimpleServiceDiscovery} = ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
const {SimpleServiceDiscovery} = ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,6 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* globals SimpleServiceDiscovery */
|
|
||||||
|
|
||||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
const {SimpleServiceDiscovery} = ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
const {SimpleServiceDiscovery} = ChromeUtils.import("resource://gre/modules/SimpleServiceDiscovery.jsm");
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче