Bug 1313440: Fix NS_ENSURE_TRUE(isSandbox) warnings in JPM bootstrap. r=erahm
authorKris Maglione <maglione.k@gmail.com>
Thu, 27 Oct 2016 13:28:49 -0700
changeset 320035 94d5d14da6bac6f013d6cc1187ac218092cea05e
parent 320034 fb2d15e4f33d8a643197563608d1c216691abb18
child 320036 f7823287275f2c2c4e2329b75057c12fc31cc806
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1313440
milestone52.0a1
Bug 1313440: Fix NS_ENSURE_TRUE(isSandbox) warnings in JPM bootstrap. r=erahm MozReview-Commit-ID: E4qgjheRyV6
addon-sdk/source/lib/sdk/addon/bootstrap.js
--- a/addon-sdk/source/lib/sdk/addon/bootstrap.js
+++ b/addon-sdk/source/lib/sdk/addon/bootstrap.js
@@ -152,21 +152,19 @@ Bootstrap.prototype = {
     return new Promise(resolve => {
       const { loader } = this;
       if (loader) {
         this.loader = null;
         unload(loader, reason);
 
         setTimeout(() => {
           for (let uri of Object.keys(loader.sandboxes)) {
-            try {
-              Cu.nukeSandbox(loader.sandboxes[uri]);
-            } catch (e) {
-              // This will throw for shared sandboxes.
-            }
+            let sandbox = loader.sandboxes[uri];
+            if (Cu.getClassName(sandbox, true) == "Sandbox")
+              Cu.nukeSandbox(sandbox);
             delete loader.sandboxes[uri];
             delete loader.modules[uri];
           }
 
           try {
             Cu.nukeSandbox(loader.sharedGlobalSandbox);
           } catch (e) {
             Cu.reportError(e);