CloudMade/Leaflet — pull request #840 by thegreat (2012-07-27 19:12:28+00:00)
Title: fix IE8 error with calling call() on window.clearTimeout()

In IE8 L.Util.cancelAnimFrame uses window.clearTimeout() as its cancelFn. I am getting "object has no property" errors when cancelFn.call(window, id) is called.

It seems that native functions in IE8 don't have .call() or .apply() methods. A simple solution here is to wrap window.clearTimeout() in a anonymous function.

Alternatively cancelFn could be called directly eg: cancelFn(id) as window is the default context anyway. I favoured the first approach in this pull request as I wasn't sure if not explicitly setting the window context would cause problems in other browsers.