documentcloud/backbone — pull request #1269 by ynniv (2012-05-01 23:20:25+00:00)
Title: Allow both constructor return values and extension of Object

The primary argument against respecting the return value of constructors appears to be that the undocumented feature "Object.extend = Backbone.Model.extend" is useful. The problem is that "Object.call(this)" returns a new object instead of undefined or "this". We can easily work around this edge case by testing for "parent === Object" and returning the current wrapper which discards the return value of the parent constructor.

This pull request restores an expected behavior of JavaScript that was unnecessarily removed by #555, and resolves issues #1216 and #1094 without regressing #555.