Bug 854948 - GCLI context.environment.contentDocument points to doc from when GCLI first opened; r=mratcliffe

This commit is contained in:
Joe Walker 2013-04-20 11:59:00 +03:00
parent 4398f0d11e
commit 33fb441011
2 changed files with 14 additions and 4 deletions

View File

@ -7308,12 +7308,10 @@ exports.Output = Output;
* Functions and data related to the execution of a command
*/
exports.createExecutionContext = function(requisition) {
return {
var context = {
exec: requisition.exec.bind(requisition),
update: requisition.update.bind(requisition),
updateExec: requisition.updateExec.bind(requisition),
document: requisition.document,
environment: requisition.environment,
createView: view.createView,
typedData: function(data, type) {
return {
@ -7334,6 +7332,18 @@ exports.createExecutionContext = function(requisition) {
return Promise.defer();
}
};
Object.defineProperty(context, 'environment', {
get: function() { return requisition.environment; },
enumerable : true
});
Object.defineProperty(context, 'document', {
get: function() { return requisition.document; },
enumerable : true
});
return context;
};

View File

@ -506,7 +506,7 @@ DeveloperToolbar.prototype.destroy = function DT_destroy()
let tabbrowser = this._chromeWindow.getBrowser();
tabbrowser.tabContainer.removeEventListener("TabSelect", this, false);
tabbrowser.tabContainer.removeEventListener("TabClose", this, false);
tabbrowser.removeEventListener("load", this, true);
tabbrowser.removeEventListener("load", this, true);
tabbrowser.removeEventListener("beforeunload", this, true);
Array.prototype.forEach.call(tabbrowser.tabs, this._stopErrorsCount, this);