[Pkg-mozext-commits] [greasemonkey] 11/21: Fix usage of `delete` to clean up sandbox scope.

David Prévot taffit at moszumanska.debian.org
Sun Sep 13 21:27:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit daa3f45c69a70546fab90da3a92f7eabbc008764
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Wed Jul 15 15:36:41 2015 -0400

    Fix usage of `delete` to clean up sandbox scope.
---
 modules/sandbox.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/sandbox.js b/modules/sandbox.js
index 8839bff..a6b8ac3 100644
--- a/modules/sandbox.js
+++ b/modules/sandbox.js
@@ -71,11 +71,13 @@ function createSandbox(aScript, aContentWin, aUrl, aFrameScope) {
   }
 
   if (GM_util.inArray(aScript.grants, 'GM_registerMenuCommand')) {
-    Components.utils.evalInSandbox(MenuCommandSandbox.toSource(), sandbox);
-    sandbox.MenuCommandSandbox(
+    Components.utils.evalInSandbox(
+        'this._MenuCommandSandbox = ' + MenuCommandSandbox.toSource(), sandbox);
+    sandbox._MenuCommandSandbox(
         aScript.uuid, aScript.name, MenuCommandRespond,
         gInvalidAccesskeyErrorStr);
-    Components.utils.evalInSandbox('delete MenuCommandSandbox;', sandbox);
+    Components.utils.evalInSandbox(
+        'delete this._MenuCommandSandbox;', sandbox);
   }
 
   var scriptStorage = new GM_ScriptStorageFront(aScript, aFrameScope, sandbox);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list