So, turns out that the problem is not with my understanding of prototypes, but in javascript's implementation of constructors in relation to their prototypal inheritance. I was attempting- without realizing it- to create a constructor that defined multiple inheritance through my function that routes the object creation to the object creation function required
. Ideally, it would pass through multiple prototypes to construct an object that inherited from multiple prototypes. Prototypal inheritance supports this, but the pseudo-constructor pattern of javascript doesn't. To work around this, I created a constructor to parse these arguments and route the object parts to the unique prototype constructors.
What I was aiming at was prototype property delegation without knowing how to properly create a dynamic, object that inherited multiple prototypes while keeping the prototype chain in tact. What I was getting was a frankensteined object thats prototype was the constructor function itself. And because its prototype was not the prototype it needed to have, attempting to inherit functions by delegation someobject.prototype.fire = function(){};
wasn't working because the object, although it inherited the concatenated properties function someobject(Arguments) { this.property = arguments;}
, it was not 'technically' an object of that prototype. Unfortunately, it seems that most every learning resource for javascript ties the constructor/prototype patterns by the hip and never even bother explaining why constructors aren't truly conducive to prototypal inheritance. Except for this great article.
I was getting the prototype chain I was because it was inheriting its prototype from the constructor itself, which was a simple function and thus a simple object. Although javascript does support property delegation and multiple inheritance, the constructor pattern does not.