Using this.prototype in a class definition?
<p>I have a class definition that is part of a class definition.</p>

<pre><code>var someObject = {
   someClass: function() {
      this.someMethod = function() {
         alert('hello');
      };
   }
}
</code></pre>

<p>I have been told that I should use prototype to add methods, as it then only needs to be created once for all instances of the object. The problem is that it seems I need to add the prototyped method <em>after</em> the constructor function is defined, like this...</p>

<pre><code>var someObject = {
   someClass: function() {

   }
}

someObject.someClass.prototype.someMethod = function() {
   alert('hello');
};
</code></pre>

<p>Ideally however I would like to define the prototyped methods within the constructor function like this...</p>

<pre><code>var someObject = {
   someClass: function() {
      this.prototype.someMethod = function() {
         alert('hello');
      };
   }
}
</code></pre>

<p>This causes an error however stating that prototype is null or not an object. Is there a way to accomplish what I would like, or is this not possible?</p>
