visionmedia/mocha — pull request #703 by domenic (2013-01-07 00:45:30+00:00)
Title: Use proper Object.create-style inheritance in browsers.

Before this pull request, inheritance in browsers was done via

```js
Test.prototype = new Runnable;
```

after this pull request it is done via

```js
function F(){}
F.prototype = Runnable.prototype;
Test.prototype = new F;
```

which is equivalent to the less-cross-browser

```js
Test.prototype = Object.create(Runnable.prototype);
```

(See [all the usual stuff about `Object.create` shims](http://stackoverflow.com/questions/10141086/understanding-crockfords-object-create-shim).)

--

The big difference is that, with this change, changes to `Runnable.prototype` propagate to `Test` instances; without it, changes do not propagate, since it just uses the version of `Runnable.prototype` that existed at the time of the `new`ing.

This helps fix domenic/mocha-as-promised#6, wherein I am plugging in to `Runnable.prototype` and expecting the changes to propagate to `Test`, etc.