Bug 801937 - JavaScript strict warning in scratchpad.js; r=harth

This commit is contained in:
Anton Kovalyov 2012-10-15 16:30:37 -07:00
parent 94902b2e3f
commit 3c7636a394

View File

@ -225,7 +225,7 @@ var Scratchpad = {
this._previousLocation != this.gBrowser.contentWindow.location.href) {
let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
this._contentSandbox = new Cu.Sandbox(contentWindow,
{ sandboxPrototype: contentWindow, wantXrays: false,
{ sandboxPrototype: contentWindow, wantXrays: false,
sandboxName: 'scratchpad-content'});
this._contentSandbox.__SCRATCHPAD__ = this;
@ -260,7 +260,7 @@ var Scratchpad = {
if (!this._chromeSandbox ||
this.browserWindow != this._previousBrowserWindow) {
this._chromeSandbox = new Cu.Sandbox(this.browserWindow,
{ sandboxPrototype: this.browserWindow, wantXrays: false,
{ sandboxPrototype: this.browserWindow, wantXrays: false,
sandboxName: 'scratchpad-chrome'});
this._chromeSandbox.__SCRATCHPAD__ = this;
addDebuggerToGlobal(this._chromeSandbox);
@ -1243,8 +1243,13 @@ var Scratchpad = {
}
this.resetContext();
this.gBrowser.selectedBrowser.removeEventListener("load",
this._reloadAndRunEvent, true);
// This event is created only after user uses 'reload and run' feature.
if (this._reloadAndRunEvent) {
this.gBrowser.selectedBrowser.removeEventListener("load",
this._reloadAndRunEvent, true);
}
this.editor.removeEventListener(SourceEditor.EVENTS.DIRTY_CHANGED,
this._onDirtyChanged);
PreferenceObserver.uninit();