Bug 1270203 - make css-angle eslint-clean; r?nchevobbe draft
authorTom Tromey <ttromey@mozilla.com>
Thu, 05 May 2016 12:26:24 -0600
changeset 363852 3fdb4099495b81f4999b6fcc3f08e564c81178a7
parent 363851 ef2b6cb2f11a1da2ad63017e8e81ab0edb34526b
child 520150 f280c177fbb2de17eb3371416fe6cb7df82bf08d
push id17322
push userttromey@mozilla.com
push dateThu, 05 May 2016 18:26:47 +0000
reviewersnchevobbe
bugs1270203
milestone49.0a1
Bug 1270203 - make css-angle eslint-clean; r?nchevobbe MozReview-Commit-ID: IfCMc8ewLDu
.eslintignore
devtools/client/shared/css-angle.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -96,16 +96,17 @@ devtools/client/netmonitor/har/test/**
 devtools/client/performance/**
 devtools/client/projecteditor/**
 devtools/client/promisedebugger/**
 devtools/client/responsivedesign/**
 devtools/client/scratchpad/**
 devtools/client/shadereditor/**
 devtools/client/shared/*.js
 devtools/client/shared/*.jsm
+!devtools/client/shared/css-angle.js
 !devtools/client/shared/css-color.js
 !devtools/client/shared/css-color-db.js
 !devtools/client/shared/css-parsing-utils.js
 devtools/client/shared/components/**
 devtools/client/shared/redux/**
 devtools/client/shared/test/**
 devtools/client/shared/vendor/**
 devtools/client/shared/widgets/**
--- a/devtools/client/shared/css-angle.js
+++ b/devtools/client/shared/css-angle.js
@@ -1,16 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {Cc, Ci} = require("chrome");
-
 const SPECIALVALUES = new Set([
   "initial",
   "inherit",
   "unset"
 ]);
 
 /**
  * This module is used to convert between various angle units.
@@ -221,50 +219,50 @@ CssAngle.prototype = {
    *
    * @return {String|Boolean}
    *         - If the current angle is a special value e.g. "inherit" then
    *           return the angle.
    *         - If the angle is invalid return an empty string.
    *         - If the angle is a regular angle e.g. 90deg so we return false
    *           to indicate that the angle is neither invalid nor special.
    */
-  _getInvalidOrSpecialValue: function() {
+  _getInvalidOrSpecialValue: function () {
     if (this.specialValue) {
       return this.specialValue;
     }
     if (!this.valid) {
       return "";
     }
     return false;
   },
 
   /**
    * Change angle
    *
    * @param  {String} angle
    *         Any valid angle value + unit string
    */
-  newAngle: function(angle) {
+  newAngle: function (angle) {
     // Store a lower-cased version of the angle to help with format
     // testing.  The original text is kept as well so it can be
     // returned when needed.
     this.lowerCased = angle.toLowerCase();
     this._angleUnitUppercase = (angle === angle.toUpperCase());
     this.authored = angle;
 
     let reg = new RegExp(
       `(${Object.keys(CssAngle.ANGLEUNIT).join("|")})$`, "i");
     let unitStartIdx = angle.search(reg);
     this.authoredAngleValue = angle.substring(0, unitStartIdx);
     this.authoredAngleUnit = angle.substring(unitStartIdx, angle.length);
 
     return this;
   },
 
-  nextAngleUnit: function() {
+  nextAngleUnit: function () {
     // Get a reordered array from the formats object
     // to have the current format at the front so we can cycle through.
     let formats = Object.keys(CssAngle.ANGLEUNIT);
     let putOnEnd = formats.splice(0, formats.indexOf(this.angleUnit));
     formats = formats.concat(putOnEnd);
     let currentDisplayedValue = this[formats[0]];
 
     for (let format of formats) {
@@ -274,17 +272,17 @@ CssAngle.prototype = {
       }
     }
     return this.toString();
   },
 
   /**
    * Return a string representing a angle
    */
-  toString: function() {
+  toString: function () {
     let angle;
 
     switch (this.angleUnit) {
       case CssAngle.ANGLEUNIT.deg:
         angle = this.deg;
         break;
       case CssAngle.ANGLEUNIT.rad:
         angle = this.rad;
@@ -304,17 +302,17 @@ CssAngle.prototype = {
       angle = angle.toUpperCase();
     }
     return angle;
   },
 
   /**
    * This method allows comparison of CssAngle objects using ===.
    */
-  valueOf: function() {
+  valueOf: function () {
     return this.deg;
   },
 };
 
 /**
  * Given a color, classify its type as one of the possible angle
  * units, as known by |CssAngle.angleUnit|.
  *