I have some code that calls
$(container).resize(myFunc);
and then later
$(container).removeResize(myFunc);
Sometimes the container is an element, other times it is the window object. The resize function has check for when this == window and forwards to the default jquery resize handler. There is no such check in the removeResize function so it goes about trying to splice __resizeListeners__ which don't exist and throws an exception.
Uncaught TypeError: Cannot read property 'splice' of undefined