You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that this inside the addEventListener callback refers to the XMLHttpRequest object (I believe) and not the RemoteFile class. The latter has a url property but not a status property, whereas the former has status but not url. Clearly this code isn't right!
Flow doesn't complain, though. It thinks this has type any in the event listener.
Where possible, the DOM declarations should indicate the type of this in callbacks to prevent this sort of mistake.
For example, Google's Closure Compiler provides an @this annotation. You can see an example of this in action in the declaration for Array.prototype.find.
Activity
samwgoldman commentedon Oct 22, 2015
Ref #452
danvk commentedon Oct 22, 2015
Closing as a dupe