I am inclined to say that this is a typo, but in an emergency it was conceived, then the only functional use case I can come up with ... ( warning: can share an opinion).
Given that the observer / event pattern is a general concept that can be applied to any object, and the "private" (indicated by the underscore) _listeners probably never be known about the target - then it is that the data contained in it is redundant for the object itself.
That is, it is probably undesirable to transmit this kind of data if the target is serialized. The following example illustrates how the JSON serializer ignores the properties of a non-numeric array in foo.baz - similarly in your own example, all attached event data will be deleted:
var foo = { bar: {}, baz: [] }; foo.bar['p1'] = foo.baz['p1'] = 1; foo.bar['p2'] = foo.baz['p2'] = 2; console.log( JSON.stringify(foo) ); // {"bar":{"p1":1,"p2":2},"baz":[]}
Emissary
source share