jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.1k stars 5.39k forks source link

Comment about combined defaults and extend #4267

Closed jgonggrijp closed 1 year ago

jgonggrijp commented 1 year ago

This proposal replaces #4088 by @unclechu. I squashed their commits and then changed the comment again in a commit of my own. In this way, @unclechu is still credited for their effort to document the code, although their PR will be marked as rejected.

In my opinion, the line in question was misguided (see also #4266). It has no advantage over a simple call to _.defaults, except that it allows you to set attribute keys that collide with Object.prototype properties. I consider that a footgun rather than a feature.

Reviews welcome.