EndangeredMassa/bond — pull request #30 by khoomeister (2014-04-20 04:38:53+00:00)
Title: ensure bond returns object from constructor

Javascript has an oddity with constructor functions where if an object is returned, it takes precedence over `this`.

You'll see what I mean when you run the below in the console:

```javascript
function Test() { this.blah = 3; return {a: 'somethingElse'}; }; new Test()
// returns {a: 'somethingElse'}

function Test() { this.blah = 3; return [1, 2, 3]; }; new Test()
// returns [1, 2, 3]

function Test() { this.blah = 3; return 123; }; new Test()
// returns {blah: 3}
```

This PR rectifies unexpected behavior when bonding to a constructor function (especially helpful when using `bond(...).to ->` on constructors during tests).