Bug 874023 - GCLI: context.environment.window not always defined when running GCLI commands; r=mratcliffe

This commit is contained in:
Joe Walker 2013-05-21 10:18:56 +01:00
parent 8b9f1e63f0
commit 2e0e758c94
2 changed files with 4 additions and 3 deletions

View File

@ -320,8 +320,9 @@ Toolbox.prototype = {
}
let toolbarSpec = CommandUtils.getCommandbarSpec("devtools.toolbox.toolbarSpec");
let environment = { chromeDocument: this.target.tab.ownerDocument };
let requisition = new Requisition(environment);
let env = CommandUtils.createEnvironment(this.target.tab.ownerDocument,
this.target.window.document);
let requisition = new Requisition(env);
let buttons = CommandUtils.createButtons(toolbarSpec, this._target, this.doc, requisition);

View File

@ -156,7 +156,7 @@ let CommandUtils = {
chromeWindow: chromeDocument.defaultView,
document: contentDocument,
window: contentDocument.defaultView
window: contentDocument != null ? contentDocument.defaultView : undefined
};
Object.defineProperty(environment, "target", {