Backed out changeset 68c5012ba344 (bug 1378850) for ESlint no-unused-vars failures on a CLOSED TREE.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 19 Jul 2017 12:26:25 -0400
changeset 369664 44ca093166f6164b7b790e4e5e760c21cd8121bb
parent 369663 9d6754fdaf26f8461210b8660655d68850143827
child 369665 e4c251c24cb0822b0c31615b581354c4662af8b8
push id32201
push userkwierso@gmail.com
push dateWed, 19 Jul 2017 23:32:11 +0000
treeherdermozilla-central@a8885191775a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1378850
milestone56.0a1
backs out68c5012ba344d4e11e7f3cd8eeba184894d90541
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
Backed out changeset 68c5012ba344 (bug 1378850) for ESlint no-unused-vars failures on a CLOSED TREE.
devtools/client/inspector/markup/utils.js
devtools/client/inspector/markup/views/element-container.js
devtools/client/inspector/markup/views/read-only-container.js
devtools/client/inspector/markup/views/text-container.js
devtools/client/webconsole/console-output.js
devtools/client/webconsole/hudservice.js
devtools/shared/extend.js
devtools/shared/moz.build
--- a/devtools/client/inspector/markup/utils.js
+++ b/devtools/client/inspector/markup/utils.js
@@ -18,16 +18,25 @@ function getOwnPropertyDescriptors(...ob
     for (let name of getNames(object)) {
       descriptors[name] = getOwnPropertyDescriptor(object, name);
     }
   }
   return descriptors;
 }
 
 /**
+ * Returns a frozen object with that inherits from the given `prototype` and
+ * implements all own properties of the given `properties` object.
+ */
+function extend(prototype, properties) {
+  return Object.create(prototype,
+                       getOwnPropertyDescriptors(properties));
+}
+
+/**
  * Apply a 'flashed' background and foreground color to elements. Intended
  * to be used with flashElementOff as a way of drawing attention to an element.
  *
  * @param  {Node} backgroundElt
  *         The element to set the highlighted background color on.
  * @param  {Node} foregroundElt
  *         The element to set the matching foreground color on.
  *         Optional.  This will equal backgroundElt if not set.
@@ -140,14 +149,15 @@ function truncateString(str, maxLength) 
   }
 
   return str.substring(0, Math.ceil(maxLength / 2)) +
          "…" +
          str.substring(str.length - Math.floor(maxLength / 2));
 }
 
 module.exports = {
+  extend,
   flashElementOn,
   flashElementOff,
   getAutocompleteMaxWidth,
   parseAttributeValues,
   truncateString,
 };
--- a/devtools/client/inspector/markup/views/element-container.js
+++ b/devtools/client/inspector/markup/views/element-container.js
@@ -10,17 +10,17 @@ const promise = require("promise");
 const Services = require("Services");
 const {Task} = require("devtools/shared/task");
 const nodeConstants = require("devtools/shared/dom-node-constants");
 const clipboardHelper = require("devtools/shared/platform/clipboard");
 const {setImageTooltip, setBrokenImageTooltip} =
       require("devtools/client/shared/widgets/tooltip/ImageTooltipHelper");
 const MarkupContainer = require("devtools/client/inspector/markup/views/markup-container");
 const ElementEditor = require("devtools/client/inspector/markup/views/element-editor");
-const {extend} = require("devtools/shared/extend");
+const {extend} = require("devtools/client/inspector/markup/utils");
 
 // Lazy load this module as _buildEventTooltipContent is only called on click
 loader.lazyRequireGetter(this, "setEventTooltip",
   "devtools/client/shared/widgets/tooltip/EventTooltipHelper", true);
 
 /**
  * An implementation of MarkupContainer for Elements that can contain
  * child nodes.
--- a/devtools/client/inspector/markup/views/read-only-container.js
+++ b/devtools/client/inspector/markup/views/read-only-container.js
@@ -1,17 +1,17 @@
 /* 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 ReadOnlyEditor = require("devtools/client/inspector/markup/views/read-only-editor");
 const MarkupContainer = require("devtools/client/inspector/markup/views/markup-container");
-const {extend} = require("devtools/shared/extend");
+const {extend} = require("devtools/client/inspector/markup/utils");
 
 /**
  * An implementation of MarkupContainer for Pseudo Elements,
  * Doctype nodes, or any other type generic node that doesn't
  * fit for other editors.
  * Does not allow any editing, just viewing / selecting.
  *
  * @param  {MarkupView} markupView
--- a/devtools/client/inspector/markup/views/text-container.js
+++ b/devtools/client/inspector/markup/views/text-container.js
@@ -2,17 +2,17 @@
  * 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 nodeConstants = require("devtools/shared/dom-node-constants");
 const TextEditor = require("devtools/client/inspector/markup/views/text-editor");
 const MarkupContainer = require("devtools/client/inspector/markup/views/markup-container");
-const {extend} = require("devtools/shared/extend");
+const {extend} = require("devtools/client/inspector/markup/utils");
 
 /**
  * An implementation of MarkupContainer for text node and comment nodes.
  * Allows basic text editing in a textarea.
  *
  * @param  {MarkupView} markupView
  *         The markup view that owns this container.
  * @param  {NodeFront} node
--- a/devtools/client/webconsole/console-output.js
+++ b/devtools/client/webconsole/console-output.js
@@ -19,23 +19,25 @@ loader.lazyRequireGetter(this, "ObjectCl
 const XHTML_NS = "http://www.w3.org/1999/xhtml";
 
 const WebConsoleUtils = require("devtools/client/webconsole/utils").Utils;
 const { getSourceNames } = require("devtools/client/shared/source-utils");
 const {Task} = require("devtools/shared/task");
 const l10n = require("devtools/client/webconsole/webconsole-l10n");
 const nodeConstants = require("devtools/shared/dom-node-constants");
 const {PluralForm} = require("devtools/shared/plural-form");
-const {extend} = require("devtools/shared/extend");
 
 const MAX_STRING_GRIP_LENGTH = 36;
 const {ELLIPSIS} = require("devtools/shared/l10n");
 
 const validProtocols = /^(http|https|ftp|data|javascript|resource|chrome):/i;
 
+const extend = (prototype, properties) =>
+  Object.create(prototype, Object.getOwnPropertyDescriptors(properties));
+
 // Constants for compatibility with the Web Console output implementation before
 // bug 778766.
 // TODO: remove these once bug 778766 is fixed.
 const COMPAT = {
   // The various categories of messages.
   CATEGORIES: {
     NETWORK: 0,
     CSS: 1,
--- a/devtools/client/webconsole/hudservice.js
+++ b/devtools/client/webconsole/hudservice.js
@@ -1,16 +1,18 @@
 /* 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, Cu} = require("chrome");
+
 var WebConsoleUtils = require("devtools/client/webconsole/utils").Utils;
-const {extend} = require("devtools/shared/extend");
+var { extend } = require("sdk/core/heritage");
 var {TargetFactory} = require("devtools/client/framework/target");
 var {Tools} = require("devtools/client/definitions");
 const { Task } = require("devtools/shared/task");
 var promise = require("promise");
 var Services = require("Services");
 
 loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
 loader.lazyRequireGetter(this, "WebConsoleFrame", "devtools/client/webconsole/webconsole", true);
deleted file mode 100644
--- a/devtools/shared/extend.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/* 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";
-
-/**
- * Utility function, that is useful for creating objects that inherit from other
- * objects, without associated classes.
- *
- * Replacement for `extends` API from "sdk/core/heritage".
- */
-exports.extend = function (prototype, properties) {
-  return Object.create(prototype, Object.getOwnPropertyDescriptors(properties));
-};
--- a/devtools/shared/moz.build
+++ b/devtools/shared/moz.build
@@ -47,26 +47,25 @@ DevToolsModules(
     'builtin-modules.js',
     'content-observer.js',
     'defer.js',
     'deprecated-sync-thenables.js',
     'DevToolsUtils.js',
     'dom-node-constants.js',
     'dom-node-filter-constants.js',
     'event-emitter.js',
-    'extend.js',
     'flags.js',
     'indentation.js',
     'l10n.js',
     'loader-plugin-raw.jsm',
     'Loader.jsm',
     'Parser.jsm',
     'path.js',
     'plural-form.js',
     'protocol.js',
     'system.js',
     'task.js',
     'ThreadSafeDevToolsUtils.js',
     'wasm-source-map.js',
 )
 
-with Files('**'):
-    BUG_COMPONENT = ('Firefox', 'Developer Tools')
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Developer Tools')