* Add sourceTarget and propagatedFrom to events
Also documents events' target, sourceTarget, propagatedFrom
and layer properties.
Fixes#4510.
* Use propagatedFrom, which is equivalent of the original code
* propagetedFrom -> propagatedFrom
* Fix L.Evented.listens() on removed event handlers, #4474
* Fix bad unit tests for marker events
* Only check for listerners.length if listerners is actually defined
This patch fixes a problem with a dangling event listener, which is
called even after it has been removed. This situation can occur when a
listener is removed during an even dispatch.
To fix this problem, the old action is replaced with a NOOP, so that
when the listener is being fired, it is not the old listener but the
NOOP.
The rationale is this: the spec string describes the expected
behavior unconditionally. The code examples, on the other hand,
set up an expectation that is tested with the call to the expect
method. The code examples can violate the expectation, but the
spec string does not. The value of the spec string is as clearly
as possible describing the behavior. Including “should” in that
description adds no value. (From http://rubyspec.org/style_guide/)
Allow L.Mixin.Events.removeEventListener() to accept one or more space-separated event types. Omitting the fn parameter will remove all event handlers for the supplied event type(s).
Also allow L.Mixin.Events.removeEventListener() to accept a map where the string keys represent one or more space-separated event types and the values represent handler functions previously attached for the event(s).
Add unit tests for the above changes.