title: Fail to `JSON.stringify(this)` when learning OOP (got RangeError: Maximum call stack size exceeded)
body: <pre><code>function MyClass() {
      this.foo = "foo";
      this.bar = "bar";
  }
  
  MyClass.prototype.toJSON = function(space) {
      if (typeof space === 'undefined') space = 4;
      return JSON.stringify(this, null, space);
  };
  
  var m = new MyClass();
  console.log(m.toJSON());
  </code></pre>
  
  <p>I ran it in node.js, and got:</p>
  
  <pre><code>MyClass.prototype.toJSON = function(space) {
                                     ^
  RangeError: Maximum call stack size exceeded
  </code></pre>
  
  <p>I don't know why. It makes me confused. Could you please tell me the reason causing this error? And how to fix it?</p>