bitpay/bitcore — pull request #432 by ryanxcharles (2014-07-16 01:39:56+00:00)
Title: Correct deprecated setting of __proto__

Setting the prototype of an object after it exists by setting __proto__ is deprecated in javascript because it is slow. I changed all instances of this in bitcore, and wrote some tests to make sure things were working correctly.

I did some performance tests to see if this made a difference. The mocha browser tests now run roughly 30% faster with this PR.

Firefox, before this PR:

* 14.64s
* 14.93s
* 14.65s

Firefox, with this PR:

* 11.40s
* 11.46s
* 11.22s

When running the tests in Firefox, we still get a warning about this, because chai, one of our dependencies, modifies __proto__. Nothing we can do about that at present.

Closes https://github.com/bitpay/bitcore/issues/427