chaijs/chai — pull request #140 by RubenVerborgh (2013-02-13 11:54:30+00:00)
Title: Restore the `call` and `apply` methods when adding a chainable method

@domenic [found](https://github.com/chaijs/chai/commit/514dd6ce4#commitcomment-2593383) that properties of `Function.prototype` where not present anymore on chainable methods after [`__proto__` support was added](https://github.com/chaijs/chai/commit/514dd6ce4) to speed things up.

This pull request fixes this. However, I would like to debate first whether it should be added.
Below are my arguments.

### pro
- It makes chai behave identically on all platforms, regardless of the presence of `__proto__`.
- It fixes the bug this caused in chai as promised (domenic/chai-as-promised#18).

### contra
- The bug in chai as promised has already been [fixed](https://github.com/domenic/chai-as-promised/commit/3ebd37257eee3a0a2af3fedc8d96a6634a86e901).
- chai as promised is probably the only plugin affected. _[citation needed]_
- It makes things more complicated.

Note that the associated commit currently only adds `call` and `apply`, and not others such as `length`, `arguments`, `name`, `caller`, `bind`, `toString`. If you think this is necessary, let me know.

Also note that the property case was never broken (i.e., the assertions on [lines 235 and 236](https://github.com/RubenVerborgh/chai/commit/caf2a151c0a4961dde185f8c7f88484c4899ac4e#L1R235) pass without the modification). Only when the property was called as a method, things didn't go as expected.