Bug 1403961, part 2 - Fix and enable eslint for ipc/. r=billm
After the previous patch, all that is needed to pass eslint is some
whitespace fixes I generated using:
./mach eslint --fix ipc
The .eslintrc.js file makes eslint expect XPCShell global variables.
With those two changes, eslint can be enabled for the ipc/ directory.
MozReview-Commit-ID: BqSICp2iV6O
--- a/.eslintignore
+++ b/.eslintignore
@@ -13,17 +13,16 @@ docshell/**
editor/**
embedding/**
extensions/cookie/**
extensions/spellcheck/**
extensions/universalchardet/**
gfx/**
image/**
intl/**
-ipc/**
layout/**
media/**
memory/**
modules/**
netwerk/**
parser/**
python/**
rdf/**
new file mode 100644
--- /dev/null
+++ b/ipc/testshell/tests/.eslintrc.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = {
+ "extends": [
+ "plugin:mozilla/xpcshell-test"
+ ]
+};
--- a/ipc/testshell/tests/test_ipcshell.js
+++ b/ipc/testshell/tests/test_ipcshell.js
@@ -13,19 +13,19 @@ function run_test() {
do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
sendCommand("load('test_ipcshell_child.js');");
sendCommand("runtime.processType;", callback);
[ [ "C", "D" ], [ "D", "C" ], [ "\u010C", "D" ], [ "D", "\u010C" ] ].forEach(
- function (pair) {
+ function(pair) {
do_test_pending();
var cmp = pair[0].localeCompare(pair[1]);
sendCommand(
- "'"+ pair[0] +"'.localeCompare('"+ pair[1] +"');",
- function (result) {
+ "'" + pair[0] + "'.localeCompare('" + pair[1] + "');",
+ function(result) {
do_check_eq(cmp, result);
- do_test_finished();
+ do_test_finished();
});
})
}
--- a/ipc/testshell/tests/test_ipcshell_child.js
+++ b/ipc/testshell/tests/test_ipcshell_child.js
@@ -1,8 +1,8 @@
-var Cc = Components.classes;
-var Ci = Components.interfaces;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
function run_test() {
do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
}