diff --git a/common/bootstrap.js b/common/bootstrap.js index 4d5dcca6..29810c0d 100755 --- a/common/bootstrap.js +++ b/common/bootstrap.js @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2011 by Kris Maglione +// Copyright (c) 2010-2014 by Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. @@ -63,7 +63,7 @@ let resources = []; let getURI = null; let JSMLoader = { - SANDBOX: Cu.nukeSandbox && false, + SANDBOX: Cu.nukeSandbox, get addon() addon, @@ -426,10 +426,11 @@ function shutdown(data, reason) { JSMLoader.atexit(strReason); JSMLoader.cleanup(strReason); + bootstrap_jsm.require = null; if (JSMLoader.SANDBOX) Cu.nukeSandbox(bootstrap); - bootstrap_jsm.require = null; - Cu.unload(BOOTSTRAP); + else + Cu.unload(BOOTSTRAP); bootstrap = null; bootstrap_jsm = null; diff --git a/common/modules/base.jsm b/common/modules/base.jsm index c15a5519..22c14a11 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -313,7 +313,9 @@ function iterOwnProperties(obj) { function deprecated(alternative, fn) { if (isObject(fn)) - return Class.Property(iter(fn).map(([k, v]) => [k, callable(v) ? deprecated(alternative, v) : v]) + return Class.Property(iter(fn).map(([k, v]) => [k, + callable(v) ? deprecated(alternative, v) + : v]) .toObject()); let name, @@ -331,6 +333,8 @@ function deprecated(alternative, fn) { alternative); return func.apply(this, arguments); } + if (func.name) + deprecatedMethod.realName = func.name; return callable(fn) ? deprecatedMethod : Class.Property({ get: function () deprecatedMethod, diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index c51c1790..259fa537 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -826,8 +826,10 @@ var JavaScript = Module("javascript", { leave: function leave(params) { leave.superapply(this, arguments); - if (!params.push) + if (!params.push) { modes.delay(function () { modes.pop(); }); + Cu.nukeSandbox(this.context); + } }, updatePrompt: function updatePrompt() {