The problem is that both views share the same Component
object, as you create only one and assign it to the prototype of the View
.
To make the views have separate Component
object you need to create one instance for each view that you create:
//Setting up everything
function View(){
this.component = new Component();
}
function Component(){}
Component.prototype.hook = function(){alert("Should be default")}
View.prototype._component = function(){throw "this function is called on Component change, so override.";};