Bug 1403961, part 2 - Fix and enable eslint for ipc/. r=billm
authorAndrew McCreight <continuation@gmail.com>
Fri, 29 Sep 2017 09:46:32 -0700
changeset 384066 cab06f0f811af8048994fdcc876584e59b3c788a
parent 384065 6201576b6471c092a32f637abb7225410f9b9eef
child 384067 a2a7b3161ac39f0a051cf53135fc477c9cee2afd
push id32619
push userarchaeopteryx@coole-files.de
push dateTue, 03 Oct 2017 09:41:33 +0000
treeherdermozilla-central@14841c4d8a97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1403961
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
.eslintignore
ipc/testshell/tests/.eslintrc.js
ipc/testshell/tests/test_ipcshell.js
ipc/testshell/tests/test_ipcshell_child.js
--- 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);
 }