title: JavaScript Object prototype function not available as expected
body: <p>If you open <a href="http://jsfiddle.net/beardtwizzle/4JCxb/embedded/result/" rel="nofollow">this JSFiddle</a>, you should see in Firebug/Chrome Dev Tools that an exception is thrown when <code>x.method</code> is called, as <code>method</code> does not exist.</p>
  
  <p>However if you run either <code>Object.method</code> or <code>Function.method</code> in the console you'll see that they do indeed exist in their respective prototypes.</p>
  
  <p>I'm sure its a simply inheritence issue, but its beyond me at this point as to why the <code>method</code> method isn't bubbling up to the <code>x</code> Object.</p>
  
  <p>The code is as follows:</p>
  
  <pre><code>// Crockford's Object.create shim
  if (typeof Object.create !== 'function') {
      Object.create = function (o) {
          var F = function () {};
          F.prototype = o;
          return new F();
      };
  }
  
  // Add a method creation function to the Function prototype
  // Note that on this line I've also tried:
  // Object.prototype.method = Function.prototype.method = function (name, func) { 
  Function.prototype.method = function (name, func) {
      this.prototype[name] = func;
      return this;
  };
  
  // Create our object
  var x = Object.create({});
  
  // Add common methods to the prototype of our new object
  x.method('logNumber', function (num) {
      console.log(num);
  });
  
  // Try it out
  x.logNumber(6);
  </code></pre>