jensarps/IDBWrapper — pull request #33 by AsaAyers (2013-09-10 00:17:58+00:00)
Title: Fix inheritance for IDBStore

I found this because extending `IDBStore` with CoffeeScript doesn't work. Normally I would have used `_.extends` instead of replacing the prototype, but since nothing else depends on underscore I didn't want to add it.

Even if you aren't interested in CoffeeScript you can see that replacing the prototype breaks normal Javascript behavior.

var ConstructorA = function() {};
ConstructorA.prototype.test = function() {
console.log("testing");
};

var ConstructorB = function() {};
ConstructorB.prototype = {
test: function() {
console.log('testing');
}
};

// true: normal behavor
console.log(ConstructorA.prototype.constructor === ConstructorA);

// false: IDBStore's current behavior
console.log(ConstructorB.prototype.constructor === ConstructorB);