Bug 935692: Don't try to fire error events on non-DOM globals. r=bent