title: Any Javascript toString() to emit JSON?
body: <p>I'm working with Javacript in Rhino and cannot import externals (but I do have access to java.lang and java.util), so I am looking for a toString() that emits JSON of the object on which it lives.</p>
  
  <pre><code>MyOjbect.prototype.toString = function() {  /* magically emits JSON of MyObject */ }
  </code></pre>
  
  <p>I don't mind writing this from scratch but if this already exists it would save some time.
  This is merely for a debugging dump to log of custom objects.</p>
  
  <p>Edit:  Older version of Rhino, updating not an option.  No stringify().</p>