Bug 1060086 - Get rid of error message 'TypeError: command.state.offChange is not a function' in mochitest-dt. r=jwalker

This commit is contained in:
Brian Grinstead 2014-08-28 19:00:00 -04:00
parent 7f93484c48
commit 05c44ed969

View File

@ -166,7 +166,9 @@ let CommandUtils = {
command.state.onChange(target, onChange);
onChange("", { target: target });
document.defaultView.addEventListener("unload", () => {
command.state.offChange(target, onChange);
if (command.state.offChange) {
command.state.offChange(target, onChange);
}
}, false);
}