Bug 1207499 - Part 1: Remove use of expression closure from b2g/. r=sicking
authorTooru Fujisawa <arai_a@mac.com>
Mon, 21 Sep 2015 00:07:44 +0900
changeset 265259 3e6465169e400a805dcff9f91c0b494476cb0d36
parent 265258 b06d2002c03bb58cf649dbd00c13cbe610038783
child 265260 4cd9898b3410492f4f815faedfd64f322dd43ffb
push id65891
push userarai_a@mac.com
push dateWed, 30 Sep 2015 16:36:04 +0000
treeherdermozilla-inbound@10194aec7255 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1207499
milestone44.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 1207499 - Part 1: Remove use of expression closure from b2g/. r=sicking
b2g/components/MailtoProtocolHandler.js
b2g/components/SimulatorScreen.js
b2g/components/SmsProtocolHandler.js
b2g/components/TelProtocolHandler.js
b2g/simulator/lib/simulator-process.js
--- a/b2g/components/MailtoProtocolHandler.js
+++ b/b2g/components/MailtoProtocolHandler.js
@@ -15,17 +15,17 @@ function MailtoProtocolHandler() {
 MailtoProtocolHandler.prototype = {
 
   scheme: "mailto",
   defaultPort: -1,
   protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE |
                  Ci.nsIProtocolHandler.URI_NOAUTH |
                  Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE |
                  Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
-  allowPort: function() false,
+  allowPort: () => false,
 
   newURI: function Proto_newURI(aSpec, aOriginCharset) {
     let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel2: function Proto_newChannel2(aURI, aLoadInfo) {
--- a/b2g/components/SimulatorScreen.js
+++ b/b2g/components/SimulatorScreen.js
@@ -57,23 +57,23 @@ function hookScreen(window) {
 
   screen.mozUnlockOrientation = function() {
     debug('mozOrientationUnlock from', origin);
     GlobalSimulatorScreen.unlock();
     return true;
   };
 
   Object.defineProperty(screen, 'width', {
-    get: function () GlobalSimulatorScreen.width
+    get: () => GlobalSimulatorScreen.width
   });
   Object.defineProperty(screen, 'height', {
-    get: function () GlobalSimulatorScreen.height
+    get: () => GlobalSimulatorScreen.height
   });
   Object.defineProperty(screen, 'mozOrientation', {
-    get: function () GlobalSimulatorScreen.mozOrientation
+    get: () => GlobalSimulatorScreen.mozOrientation
   });
 }
 
 function SimulatorScreen() {}
 SimulatorScreen.prototype = {
   classID:         Components.ID('{c83c02c0-5d43-4e3e-987f-9173b313e880}'),
   QueryInterface:  XPCOMUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
--- a/b2g/components/SmsProtocolHandler.js
+++ b/b2g/components/SmsProtocolHandler.js
@@ -24,17 +24,17 @@ function SmsProtocolHandler() {
 SmsProtocolHandler.prototype = {
 
   scheme: "sms",
   defaultPort: -1,
   protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE |
                  Ci.nsIProtocolHandler.URI_NOAUTH |
                  Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE |
                  Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
-  allowPort: function() false,
+  allowPort: () => false,
 
   newURI: function Proto_newURI(aSpec, aOriginCharset) {
     let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel2: function Proto_newChannel2(aURI, aLoadInfo) {
--- a/b2g/components/TelProtocolHandler.js
+++ b/b2g/components/TelProtocolHandler.js
@@ -23,17 +23,17 @@ function TelProtocolHandler() {
 TelProtocolHandler.prototype = {
 
   scheme: "tel",
   defaultPort: -1,
   protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE |
                  Ci.nsIProtocolHandler.URI_NOAUTH |
                  Ci.nsIProtocolHandler.URI_LOADABLE_BY_ANYONE |
                  Ci.nsIProtocolHandler.URI_DOES_NOT_RETURN_DATA,
-  allowPort: function() false,
+  allowPort: () => false,
 
   newURI: function Proto_newURI(aSpec, aOriginCharset) {
     let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel2: function Proto_newChannel(aURI, aLoadInfo) {
--- a/b2g/simulator/lib/simulator-process.js
+++ b/b2g/simulator/lib/simulator-process.js
@@ -16,34 +16,36 @@ const { Promise: promise } = Cu.import("
 const { EventEmitter } = Cu.import("resource://gre/modules/devtools/shared/event-emitter.js", {});
 
 
 // Log subprocess error and debug messages to the console.  This logs messages
 // for all consumers of the API.  We trim the messages because they sometimes
 // have trailing newlines.  And note that registerLogHandler actually registers
 // an error handler, despite its name.
 Subprocess.registerLogHandler(
-  function(s) console.error("subprocess: " + s.trim())
+  s => console.error("subprocess: " + s.trim())
 );
 Subprocess.registerDebugHandler(
-  function(s) console.debug("subprocess: " + s.trim())
+  s => console.debug("subprocess: " + s.trim())
 );
 
 function SimulatorProcess(options) {
   this.options = options;
 
   EventEmitter.decorate(this);
   this.on("stdout", (e, data) => { console.log(data.trim()) });
   this.on("stderr", (e, data) => { console.error(data.trim()) });
 }
 
 SimulatorProcess.prototype = {
 
   // check if b2g is running
-  get isRunning() !!this.process,
+  get isRunning() {
+    return !!this.process;
+  },
 
   /**
    * Start the process and connect the debugger client.
    */
   run: function() {
     // kill before start if already running
     if (this.process != null) {
       this.process