mootools/mootools-core — pull request #2384 by danielbeardsley (2012-07-18 16:12:36+00:00)
Title: Fix a bug: Events broken with prototype usage

It was previously impossible to use the Events class
as part of the normal Javascript prototype hierarchy.
The '$events' property was defined on the prototype
itself which meant that code like the below would
produce unexepected results.

function Thing() {}
Thing.prototype = new Events();

All instances of Thing would end up sharing the same
object in their '$events' property because it was
defined on the prototype. Fixing this usage (and any
usage outside Mootools Class system) is simple.

This adds appropriate tests to highlight the problem
and the changes nevessary to overcome it.