fgnass/spin.js — pull request #61 by psionides (2012-03-21 14:22:17+00:00)
Title: fixed constructor property on Spinner instances

When you overwrite `Spinner.prototype` to define instance methods, it loses the the `constructor` property which is set by default to the class itself, which can be used to identify object constructors. This may break inheritance chain if the user makes a class that inherits from `Spinner`, e.g. using Coffeescript's class inheritance.

This is how it should work:

```
function Spinner() {}
=> undefined
(new Spinner).constructor
=> function Spinner() {}
```

This is what happens if you overwrite the prototype:

```
Spinner.prototype = {}
=> Object
(new Spinner).constructor
=> function Object() { [native code] }
```