bug 1521385: toolkit: export ActorChild in global scope; r=Felipe
☠☠ backed out by 32440769ba00 ☠ ☠
authorAndreas Tolfsen <ato@sny.no>
Mon, 21 Jan 2019 00:23:02 +0000
changeset 511729 4b6549b8a6012efa6a3b250b26fff7cf0d1ca564
parent 511728 666abafd77b1e8a5e8cb83824480ed99635f9684
child 511730 32440769ba00494e8e96bea0af17e792688ea7a1
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1521385
milestone66.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 1521385: toolkit: export ActorChild in global scope; r=Felipe JS classes, unlike var or const, are not automatically made part of the global scope in JSMs. This makes it impossible to import ActorChild this way: const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm", {}); By assigning the ActorChild class to this we work around this problem. Differential Revision: https://phabricator.services.mozilla.com/D17080
toolkit/modules/ActorChild.jsm
--- a/toolkit/modules/ActorChild.jsm
+++ b/toolkit/modules/ActorChild.jsm
@@ -11,17 +11,17 @@ var EXPORTED_SYMBOLS = ["ActorChild"];
  * ActorManagerParent and implemented in the child process. It currently takes
  * care of setting the `mm`, `content`, and `docShell` properties based on the
  * message manager it's bound to, but may do more in the future.
  *
  * If Fission is being simulated, and the actor is registered as "allFrames",
  * the `content` property of this class will be bound to a specific subframe.
  * Otherwise, the `content` is always the top-level content tied to the `mm`.
  */
-class ActorChild {
+this.ActorChild = class ActorChild {
   constructor(dispatcher) {
     this._dispatcher = dispatcher;
     this.mm = dispatcher.mm;
   }
 
   get content() {
     return this._dispatcher.window;
   }
@@ -42,9 +42,9 @@ class ActorChild {
     data.frameId = this._dispatcher.frameId;
     data.browsingContextId = this._dispatcher.browsingContextId;
     this.mm.sendAsyncMessage(msg, data);
   }
 
   cleanup() {
     this._dispatcher = null;
   }
-}
+};