kriszyp/compose — pull request #10 by neonstalwart (2011-11-30 04:14:14+00:00)
Title: instance.constructor does not match the function used to create the instance

sometimes, you may want to hang things off the constructor - "static" properties. to access these generically from an instance, you would use `this.constructor` to get to the constructor. to make this work, `prototype.constructor` needs to be set to the constructor returned from compose.

```js
var Foo = compose(function () {
// using this.constructor allows subclasses
// to define their own important things but
// still apply this logic
for (var i in this.constructor.important) {
// do important things
}
});

Foo.important = {
nothing: false
};

var Bar = compose(Foo, {
stuff: '...'
});

Bar.important = {
stuff: true
};

// it.constructor should be Bar
var it = new Bar();
```

this pull request adds a test that should show the problem and also includes a fix.

btw, you may want to look at updating the package.json as well so that `dependencies` -> `devDependencies` and point to the latest version of patr