subclass accessing parent's closure variable
<p>I am using John Resig's inheritance implementation for my current project, and I was wondering if there is a way for subclass to also inherit(access) parent's closure variable...  </p>

<p>for example, I write the following class</p>

<pre><code>var Foo = (function() {  
  var p = "im p";

  var Foo = Class.extend({  
    getp : function() {
       return p;
    }
  });

  return Foo;
})();
</code></pre>

<p>now Foo class has access to the variable p in the closure. so are Foo's subclass...</p>

<pre><code>var Bar = Foo.extend({});  
var bar = new Bar;
bar.getp(); // "im p"
</code></pre>

<p>this is no surprise since bar.getp simply call Foo.getp, which has access to p. however if i overwrite bar.getp</p>

<pre><code>var Bar = Foo.extend({
  getp : function() {
    return p;
  }
});
</code></pre>

<p>now when I do bar.getp(), it will throw p is undefined since it is not accessible to bar</p>

<p>I have several methods in mind to make p accessible to bar, but I think they are little awkward, what you think is the cleanest way to accomplish this.</p>
