Bug 1400566 - Explicitly get the global of |this| in CoverageUtils.jsm. r=kmag draft
authorAndrew McCreight <continuation@gmail.com>
Sat, 16 Sep 2017 11:06:17 -0700
changeset 665951 c147a2881b5295b6fb6271e010ea9dcd9f218757
parent 665088 8e818b5e9b6bef0fc1a5c527ecf30b0d56a02f14
child 731938 04c8c3acd17693163954c2e7add8a53e7f7e5a38
push id80232
push userbmo:continuation@gmail.com
push dateSat, 16 Sep 2017 18:07:34 +0000
reviewerskmag
bugs1400566
milestone57.0a1
Bug 1400566 - Explicitly get the global of |this| in CoverageUtils.jsm. r=kmag With shared JSM globals, |this| is an NSVO, not a global. MozReview-Commit-ID: V1j4tipw3m
testing/modules/CoverageUtils.jsm
--- a/testing/modules/CoverageUtils.jsm
+++ b/testing/modules/CoverageUtils.jsm
@@ -10,17 +10,17 @@ this.EXPORTED_SYMBOLS = [
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 /* globals Debugger */
 const {addDebuggerToGlobal} = Cu.import("resource://gre/modules/jsdebugger.jsm",
                                         {});
-addDebuggerToGlobal(this);
+addDebuggerToGlobal(Cu.getGlobalForObject(this));
 
 /**
  * Records coverage for each test by way of the js debugger.
  */
 this.CoverageCollector = function(prefix) {
   this._prefix = prefix;
   this._dbg = new Debugger();
   this._dbg.collectCoverageInfo = true;