canjs / can-zone

A context for tracking asynchronous activity in JavaScript applications.
https://v4.canjs.com/doc/can-zone.html
MIT License
92 stars 4 forks source link

Event listeners called via `onclick` syntax #158

Closed matthewp closed 6 years ago

matthewp commented 6 years ago

Using the on setters doesn't cause the callbacks to be run within a Zone. We can fix this by using Object.getOwnPropertyNames(HTMLElement.prototype) and registering our own setters for the on ones, that then does the same logic as our addEventListener override.