Bug 1174821 - 5 - More eslint cleanup of view.js; r=janx
authorPatrick Brosset <pbrosset@mozilla.com>
Tue, 16 Jun 2015 17:12:12 +0200
changeset 279956 721e9f35623f96bd8cb194928ed1b46083947f2b
parent 279955 22b8d6aa174ff20f25858cc226f9bed7681776b6
child 279957 012aa1862a20dd0c316a36a3c7e11ce5af3e1bb2
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanx
bugs1174821
milestone41.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 1174821 - 5 - More eslint cleanup of view.js; r=janx
browser/devtools/layoutview/view.js
--- a/browser/devtools/layoutview/view.js
+++ b/browser/devtools/layoutview/view.js
@@ -2,29 +2,29 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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/. */
 /* globals ViewHelpers, window, document */
 
 "use strict";
 
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
+const {utils: Cu, interfaces: Ci, classes: Cc} = Components;
 
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/devtools/Loader.jsm");
 Cu.import("resource://gre/modules/devtools/Console.jsm");
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 
-const {InplaceEditor, editableItem} = devtools.require("devtools/shared/inplace-editor");
-const {ReflowFront} = devtools.require("devtools/server/actors/layout");
+const {require} = devtools;
+const {InplaceEditor, editableItem} = require("devtools/shared/inplace-editor");
+const {ReflowFront} = require("devtools/server/actors/layout");
 
-const SHARED_L10N = new ViewHelpers.L10N("chrome://browser/locale/devtools/shared.properties");
+const STRINGS_URI = "chrome://browser/locale/devtools/shared.properties";
+const SHARED_L10N = new ViewHelpers.L10N(STRINGS_URI);
 const NUMERIC = /^-?[\d\.]+$/;
 const LONG_TEXT_ROTATE_LIMIT = 3;
 
 /**
  * An instance of EditingSession tracks changes that have been made during the
  * modification of box model values. All of these changes can be reverted by
  * calling revert.
  *
@@ -260,21 +260,21 @@ LayoutView.prototype = {
     let { property } = dimension;
     let session = new EditingSession(document, this.elementRules);
     let initialValue = session.getProperty(property);
 
     let editor = new InplaceEditor({
       element: element,
       initial: initialValue,
 
-      start: (editor) => {
+      start: editor => {
         editor.elt.parentNode.classList.add("editing");
       },
 
-      change: (value) => {
+      change: value => {
         if (NUMERIC.test(value)) {
           value += "px";
         }
 
         let properties = [
           { name: property, value: value }
         ];