Is there a good pattern for JavaScript calling overridden functions in a parent without knowing the specific parent?
<p>Basically I want inheritable functions as in</p>

<pre><code>Base = function() { };

Base.prototype.foo = function() {
  console.log("base foo");
};

Derived = function() { };

somelib.inherit(Derived, Base);

Derived.prototype.foo = function() {
  console.log("derived foo");
}

d = new Derived():
d.foo();
</code></pre>

<p>And I want it to print</p>

<pre><code>derived foo
base foo
</code></pre>

<p>Yes I know I can explicitly call Base.prototype.foo.call(this); I'm just wondering if there is a pattern for calling overridden super class functions automatically. The problem I'm trying to solve is 2 fold. </p>

<ol>
<li>derived classes should NOT have to remember to call their parent's method, it just happens automatically.</li>
<li>if 1. can't happen then at least I'd like Derived not to call Base by name since that's brittle. Rather I'd like it call parentclass or something so you don't have to know the base. That way if you change the name of the base you don't have to go fixing every derived class.</li>
</ol>
