Bug 1292245 - remove some unnecessary imports of chrome from devtools; r=gregtatum
authorTom Tromey <tom@tromey.com>
Thu, 04 Aug 2016 11:55:40 -0600
changeset 308419 192132a4cbc78fa948ad1e37c204f537043fc37e
parent 308418 aaa21719d503a81aa9d8e16af5afff7c07fac735
child 308420 43f25602dac0aed6aafd8cfc9f9d45b2d047e791
child 308452 642df8f89dbb5377a73022a249a5826a9f3920d0
push id80334
push userkwierso@gmail.com
push dateFri, 05 Aug 2016 21:06:09 +0000
treeherdermozilla-inbound@12b31a12d10a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgregtatum
bugs1292245
milestone51.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 1292245 - remove some unnecessary imports of chrome from devtools; r=gregtatum MozReview-Commit-ID: JVVVHAImsko
.eslintignore
devtools/shared/async-utils.js
devtools/shared/indentation.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -120,19 +120,21 @@ devtools/server/actors/**
 !devtools/server/actors/webbrowser.js
 !devtools/server/actors/webextension.js
 !devtools/server/actors/styles.js
 !devtools/server/actors/string.js
 !devtools/server/actors/csscoverage.js
 devtools/server/performance/**
 devtools/server/tests/**
 devtools/shared/*.js
+!devtools/shared/async-utils.js
 !devtools/shared/css-lexer.js
 !devtools/shared/defer.js
 !devtools/shared/event-emitter.js
+!devtools/shared/indentation.js
 !devtools/shared/loader-plugin-raw.jsm
 !devtools/shared/task.js
 devtools/shared/*.jsm
 !devtools/shared/Loader.jsm
 devtools/shared/apps/**
 devtools/shared/client/**
 devtools/shared/discovery/**
 devtools/shared/gcli/**
--- 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.
  */
 
-var {Cu} = require("chrome");
 var {Task} = require("devtools/shared/task");
 var Promise = require("promise");
 
 /**
  * Create an async function that only executes once per instance of an object.
  * Once called on a given object, the same promise will be returned for any
  * future calls for that object.
  *
@@ -49,17 +48,17 @@ exports.asyncOnce = function asyncOnce(f
  * @param  Boolean useCapture
  *         Should we initiate the capture phase?
  * @return Promise
  *         The promise resolved with the event object when the event first
  *         happens
  */
 exports.listenOnce = function listenOnce(element, event, useCapture) {
   return new Promise(function (resolve, reject) {
-    var onEvent = function (ev) {
+    let onEvent = function (ev) {
       element.removeEventListener(event, onEvent, useCapture);
       resolve(ev);
     };
     element.addEventListener(event, onEvent, useCapture);
   });
 };
 
 /**
--- a/devtools/shared/indentation.js
+++ b/devtools/shared/indentation.js
@@ -1,17 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
 /* vim:set ts=2 sw=2 sts=2 et 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/. */
 
 "use strict";
 
-const { Cu } = require("chrome");
 const Services = require("Services");
 
 const EXPAND_TAB = "devtools.editor.expandtab";
 const TAB_SIZE = "devtools.editor.tabsize";
 const DETECT_INDENT = "devtools.editor.detectindentation";
 const DETECT_INDENT_MAX_LINES = 500;
 
 /**