Bug 1267378 - Follow-up to fix devtools space-before-function-paren errors
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 28 Apr 2016 01:19:08 -0700
changeset 295103 d2a63cc368c90d4aa5086995b934aa84d7532709
parent 295102 42c6ad3fc6838d781b21ec8671238e473569db45
child 295104 39fed34b13485656696a37c1cf94eac5a56f1f09
push id30219
push usercbook@mozilla.com
push dateThu, 28 Apr 2016 14:14:05 +0000
treeherdermozilla-central@53765e008b97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1267378
milestone49.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 1267378 - Follow-up to fix devtools space-before-function-paren errors MozReview-Commit-ID: DCCsgYbGxcr
devtools/client/styleeditor/test/browser_styleeditor_cmd_edit.html
devtools/shared/css-color.js
--- a/devtools/client/styleeditor/test/browser_styleeditor_cmd_edit.html
+++ b/devtools/client/styleeditor/test/browser_styleeditor_cmd_edit.html
@@ -3,17 +3,17 @@
 <!-- Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/ -->
 <head>
   <meta charset="utf-8">
   <title>Resources</title>
   <script type="text/javascript;version=1.8" id="script1">
     "use strict";
 
-    window.addEventListener("load", function() {
+    window.addEventListener("load", function onload() {
       let pid = document.getElementById("pid");
       let div = document.createElement("div");
       div.id = "divid";
       div.classList.add("divclass");
       div.appendChild(document.createTextNode("div"));
       div.setAttribute("data-a1", "div");
       pid.parentNode.appendChild(div);
     });
--- a/devtools/shared/css-color.js
+++ b/devtools/shared/css-color.js
@@ -97,17 +97,17 @@ CssColor.prototype = {
 
   /**
    * If the current color unit pref is "authored", then set the
    * default color unit from the given color.  Otherwise, leave the
    * color unit untouched.
    *
    * @param {String} color The color to use
    */
-  setAuthoredUnitFromColor: function(color) {
+  setAuthoredUnitFromColor: function (color) {
     if (Services.prefs.getCharPref(COLOR_UNIT_PREF) ===
         CssColor.COLORUNIT.authored) {
       this._colorUnit = classifyColor(color);
       this._colorUnitUppercase = (color === color.toUpperCase());
     }
   },
 
   get hasAlpha() {
@@ -257,42 +257,42 @@ CssColor.prototype = {
    *
    * @return {String|Boolean}
    *         - If the current color is a special value e.g. "transparent" then
    *           return the color.
    *         - If the color is invalid return an empty string.
    *         - If the color is a regular color e.g. #F06 so we return false
    *           to indicate that the color is neither invalid or special.
    */
-  _getInvalidOrSpecialValue: function() {
+  _getInvalidOrSpecialValue: function () {
     if (this.specialValue) {
       return this.specialValue;
     }
     if (!this.valid) {
       return "";
     }
     return false;
   },
 
   /**
    * Change color
    *
    * @param  {String} color
    *         Any valid color string
    */
-  newColor: function(color) {
+  newColor: function (color) {
     // Store a lower-cased version of the color to help with format
     // testing.  The original text is kept as well so it can be
     // returned when needed.
     this.lowerCased = color.toLowerCase();
     this.authored = color;
     return this;
   },
 
-  nextColorUnit: function() {
+  nextColorUnit: function () {
     // Reorder the formats array to have the current format at the
     // front so we can cycle through.
     let formats = ["hex", "hsl", "rgb", "name"];
     let currentFormat = classifyColor(this.toString());
     let putOnEnd = formats.splice(0, formats.indexOf(currentFormat));
     formats = formats.concat(putOnEnd);
     let currentDisplayedColor = this[formats[0]];
 
@@ -304,17 +304,17 @@ CssColor.prototype = {
     }
 
     return this.toString();
   },
 
   /**
    * Return a string representing a color of type defined in COLOR_UNIT_PREF.
    */
-  toString: function() {
+  toString: function () {
     let color;
 
     switch (this.colorUnit) {
       case CssColor.COLORUNIT.authored:
         color = this.authored;
         break;
       case CssColor.COLORUNIT.hex:
         color = this.hex;
@@ -339,42 +339,42 @@ CssColor.prototype = {
 
     return color;
   },
 
   /**
    * Returns a RGBA 4-Tuple representation of a color or transparent as
    * appropriate.
    */
-  _getRGBATuple: function() {
+  _getRGBATuple: function () {
     let tuple = DOMUtils.colorToRGBA(this.authored);
 
     tuple.a = parseFloat(tuple.a.toFixed(1));
 
     return tuple;
   },
 
-  _hsl: function(maybeAlpha) {
+  _hsl: function (maybeAlpha) {
     if (this.lowerCased.startsWith("hsl(") && maybeAlpha === undefined) {
       // We can use it as-is.
       return this.authored;
     }
 
     let {r, g, b} = this._getRGBATuple();
     let [h, s, l] = rgbToHsl([r, g, b]);
     if (maybeAlpha !== undefined) {
       return "hsla(" + h + ", " + s + "%, " + l + "%, " + maybeAlpha + ")";
     }
     return "hsl(" + h + ", " + s + "%, " + l + "%)";
   },
 
   /**
    * This method allows comparison of CssColor objects using ===.
    */
-  valueOf: function() {
+  valueOf: function () {
     return this.rgba;
   },
 };
 
 /**
  * Convert rgb value to hsl
  *
  * @param {array} rgb
@@ -464,11 +464,11 @@ function classifyColor(value) {
   } else if (value.startsWith("hsl(") || value.startsWith("hsla(")) {
     return CssColor.COLORUNIT.hsl;
   } else if (/^#[0-9a-f]+$/.exec(value)) {
     return CssColor.COLORUNIT.hex;
   }
   return CssColor.COLORUNIT.name;
 }
 
-loader.lazyGetter(this, "DOMUtils", function() {
+loader.lazyGetter(this, "DOMUtils", function () {
   return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
 });