title: How to stringify inherited objects to JSON?
body: <p>json2.js seems to ignore members of the parent object when using JSON.stringify(). Example:</p>
  
  <pre><code>require('./json2.js');
  
  function WorldObject(type) {    
      this.position = 4;
  }
  
  function Actor(val) {
      this.someVal = 50;
  }
  
  Actor.prototype = new WorldObject();
  
  var a = new Actor(2);
  
  console.log(a.position);
  console.log(JSON.stringify(a));
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>4
  {"someVal":50}
  </code></pre>
  
  <p>I would expect this output:</p>
  
  <pre><code>4
  {"position":0, "someVal":50}
  </code></pre>