Bug 1440320 - manual fixes r=jryans draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 19 Feb 2018 02:50:40 -0800
changeset 758723 341c2c1bb51597a7a291ad304e4e44ab2fe14d4d
parent 758722 96e50b2a69b7f0726904891f774f5f1f5db49f21
push id100153
push userbmo:poirot.alex@gmail.com
push dateThu, 22 Feb 2018 23:06:32 +0000
reviewersjryans
bugs1440320
milestone60.0a1
Bug 1440320 - manual fixes r=jryans There is eslint fixes, but not only. xpchell script also introduced real errors that had to be fixed manually. MozReview-Commit-ID: 5WwX9B5Gtpd
devtools/shared/async-utils.js
devtools/shared/fronts/memory.js
devtools/shared/security/auth.js
devtools/shared/security/socket.js
devtools/shared/system.js
devtools/shared/webconsole/test/test_jsterm.html
devtools/shared/webconsole/test/test_jsterm_autocomplete.html
--- a/devtools/shared/async-utils.js
+++ b/devtools/shared/async-utils.js
@@ -8,17 +8,16 @@
  * Helpers for async functions. Async functions are generator functions that are
  * run by Tasks. An async function returns a Promise for the resolution of the
  * function. When the function returns, the promise is resolved with the
  * returned value. If it throws the promise rejects with the thrown error.
  *
  * See Task documentation at https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Task.jsm.
  */
 
-
 /**
  * Adds an event listener to the given element, and then removes its event
  * listener once the event is called, returning the event object as a promise.
  * @param  nsIDOMElement element
  *         The DOM element to listen on
  * @param  String event
  *         The name of the event type to listen for
  * @param  Boolean useCapture
--- a/devtools/shared/fronts/memory.js
+++ b/devtools/shared/fronts/memory.js
@@ -43,17 +43,17 @@ const MemoryFront = protocol.FrontClassW
   saveHeapSnapshot: protocol.custom(async function (options = {}) {
     const snapshotId = await this._saveHeapSnapshotImpl(options.boundaries);
 
     if (!options.forceCopy &&
         (await HeapSnapshotFileUtils.haveHeapSnapshotTempFile(snapshotId))) {
       return HeapSnapshotFileUtils.getHeapSnapshotTempFilePath(snapshotId);
     }
 
-    return await this.transferHeapSnapshot(snapshotId);
+    return this.transferHeapSnapshot(snapshotId);
   }, {
     impl: "_saveHeapSnapshotImpl"
   }),
 
   /**
    * Given that we have taken a heap snapshot with the given id, transfer the
    * heap snapshot file to the client. The path to the client's local file is
    * returned.
--- a/devtools/shared/security/auth.js
+++ b/devtools/shared/security/auth.js
@@ -337,17 +337,17 @@ OOBCert.Client.prototype = {
       // authentication steps
       if (activeSendDialog && activeSendDialog.close) {
         activeSendDialog.close();
         activeSendDialog = null;
       }
     };
 
     transport.hooks = {
-      async onPacket(packet) {
+      onPacket: async (packet) => {
         closeDialog();
         let { authResult } = packet;
         switch (authResult) {
           case AuthenticationResult.PENDING:
             // Step B.8
             // Client creates hash(ClientCert) + K(random 128-bit number)
             oobData = await this._createOOB();
             activeSendDialog = this.sendOOB({
@@ -376,17 +376,17 @@ OOBCert.Client.prototype = {
             // Debugging begins
             transport.hooks = null;
             deferred.resolve(transport);
             break;
           default:
             transport.close(new Error("Invalid auth result: " + authResult));
             break;
         }
-      }.bind(this),
+      },
       onClosed(reason) {
         closeDialog();
         // Transport died before auth completed
         transport.hooks = null;
         deferred.reject(reason);
       }
     };
     transport.ready();
--- a/devtools/shared/security/socket.js
+++ b/devtools/shared/security/socket.js
@@ -47,17 +47,16 @@ DevToolsUtils.defineLazyGetter(this, "ce
          .getService(Ci.nsICertOverrideService);
 });
 
 DevToolsUtils.defineLazyGetter(this, "nssErrorsService", () => {
   return Cc["@mozilla.org/nss_errors_service;1"]
          .getService(Ci.nsINSSErrorsService);
 });
 
-
 var DebuggerSocket = {};
 
 /**
  * Connects to a debugger server socket.
  *
  * @param host string
  *        The host name or IP address of the debugger server.
  * @param port number
--- a/devtools/shared/system.js
+++ b/devtools/shared/system.js
@@ -318,13 +318,13 @@ function getSetting(name) {
       handleError: (error) => deferred.reject(error),
     });
   } else {
     deferred.reject(new Error("No settings service"));
   }
   return deferred.promise;
 }
 
-exports.getSystemInfo = Task.async(getSystemInfo);
+exports.getSystemInfo = getSystemInfo;
 exports.getSetting = getSetting;
 exports.getScreenDimensions = getScreenDimensions;
 exports.getOSCPU = getOSCPU;
 exports.constants = AppConstants;
--- a/devtools/shared/webconsole/test/test_jsterm.html
+++ b/devtools/shared/webconsole/test/test_jsterm.html
@@ -60,19 +60,17 @@ function onAttach(aState, aResponse)
     top.largeObject2['a' + i] = i;
   }
 
   gState = aState;
 
   let tests = [doSimpleEval, doWindowEval, doEvalWithException,
                doEvalWithHelper, doEvalString, doEvalLongString,
                doEvalWithBinding, doEvalWithBindingFrame,
-               forceLexicalInit].map(t => {
-                 return Task.async(t);
-               });
+               forceLexicalInit];
 
   runTests(tests, testEnd);
 }
 
 async function doSimpleEval() {
   info("test eval '2+2'");
   let response = await evaluateJS("2+2");
   checkObject(response, {
--- a/devtools/shared/webconsole/test/test_jsterm_autocomplete.html
+++ b/devtools/shared/webconsole/test/test_jsterm_autocomplete.html
@@ -72,19 +72,17 @@ let onAttach = async function (aState, r
       window.largeObject2['a' + i] = i;
     }
   `;
 
   await evaluateJS(script);
 
   let tests = [doAutocomplete1, doAutocomplete2, doAutocomplete3,
                doAutocomplete4, doAutocompleteLarge1,
-               doAutocompleteLarge2].map(t => {
-                 return Task.async(t);
-               });
+               doAutocompleteLarge2];
 
   runTests(tests, testEnd);
 };
 
 async function doAutocomplete1() {
   info("test autocomplete for 'window.foo'");
   let response = await autocompletePromise("window.foo", 10);
   let matches = response.matches;