akre54 / Backbone.NativeView

A reference implementation of a native Backbone.View
MIT License
113 stars 18 forks source link

_domEvents prototype attribute is useless? #1

Closed wyuenho closed 10 years ago

wyuenho commented 10 years ago

https://github.com/akre54/Backbone.NativeView/blob/0.2.1/backbone.nativeview.js#L52

You will always assign it an empty list in the constructor anyway, so it's not needed right?

akre54 commented 10 years ago

It's more about style for debugging. To me, undefined is "this was either not set or has been set to blank". null is "this is intentionally blank. If it hasn't been set something is wrong".

We need it on every instance (shared across prototype leads to clashes), so I set it in the constructor.