Test that window.onerror is called on window object. Bug 8519.