title: How to convert anything to a String safely in JavaScript
body: <p>If I have:</p>
  
  <pre><code>var test = {toString: function(){alert("evil code"); return "test";}};
  </code></pre>
  
  <p>how can I convert <code>test</code> to a string? without calling <code>test.toString()</code> and without using a <code>typeof x == "string"</code> check since I want to allow non strings.</p>
  
  <p>Note: this is for a FF extension dealing with objects from a content page's js scope.</p>