bug 1521385: toolkit: export ActorChild in global scope; r=Felipe
authorAndreas Tolfsen <ato@sny.no>
Mon, 21 Jan 2019 00:23:02 +0000
changeset 514615 2b62559fb02b566aa10476ea77169df02cee7807
parent 514614 d5962d1b5b32ae02d810a1cf74a484f6df8e90ec
child 514616 60944b0fca8ffa2371774326101bffc9a1ed6ec5
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [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;
   }
-}
+};