Bug 1494162 - Part 11: Lazy load promiseWarn in the rules model. r=pbro
☠☠ backed out by 14272a8b7f32 ☠ ☠
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 28 Sep 2018 12:48:06 -0400
changeset 487059 f700e44ea63fb36f5dff6341c23b004e1c30bee6
parent 487058 cb2b02dc4b47246e09aebabb31ba1f03ddfe2dfd
child 487060 10143ae649e5249d39fcf0947ee9b9c671023ed3
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewerspbro
bugs1494162
milestone64.0a1
Bug 1494162 - Part 11: Lazy load promiseWarn in the rules model. r=pbro
devtools/client/inspector/rules/models/element-style.js
devtools/client/inspector/rules/models/rule.js
--- a/devtools/client/inspector/rules/models/element-style.js
+++ b/devtools/client/inspector/rules/models/element-style.js
@@ -2,20 +2,21 @@
  * 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 promise = require("promise");
 const Rule = require("devtools/client/inspector/rules/models/rule");
 const UserProperties = require("devtools/client/inspector/rules/models/user-properties");
-const { promiseWarn } = require("devtools/client/inspector/shared/utils");
 const { getCssProperties, isCssVariable } = require("devtools/shared/fronts/css-properties");
 const { ELEMENT_STYLE } = require("devtools/shared/specs/styles");
 
+loader.lazyRequireGetter(this, "promiseWarn", "devtools/client/inspector/shared/utils", true);
+
 /**
  * ElementStyle is responsible for the following:
  *   Keeps track of which properties are overridden.
  *   Maintains a list of Rule objects for a given element.
  *
  * @param  {Element} element
  *         The element whose style we are viewing.
  * @param  {CssRuleView} ruleView
--- a/devtools/client/inspector/rules/models/rule.js
+++ b/devtools/client/inspector/rules/models/rule.js
@@ -5,20 +5,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const promise = require("promise");
 const CssLogic = require("devtools/shared/inspector/css-logic");
 const {ELEMENT_STYLE} = require("devtools/shared/specs/styles");
 const TextProperty = require("devtools/client/inspector/rules/models/text-property");
-const {promiseWarn} = require("devtools/client/inspector/shared/utils");
 const {parseNamedDeclarations} = require("devtools/shared/css/parsing-utils");
 const Services = require("Services");
 
+loader.lazyRequireGetter(this, "promiseWarn", "devtools/client/inspector/shared/utils", true);
+
 const STYLE_INSPECTOR_PROPERTIES = "devtools/shared/locales/styleinspector.properties";
 const {LocalizationHelper} = require("devtools/shared/l10n");
 const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
 
 /**
  * Rule is responsible for the following:
  *   Manages a single style declaration or rule.
  *   Applies changes to the properties in a rule.