Javascript WTF: a String.prototype's "this" doesn't return a string?
<p>What is going on here? Just when I thought I knew JS inside and out, this gem comes up.</p>

<pre><code>String.prototype.doNothing = function() {
  return this;
};

alert(typeof 'foo'.doNothing()) // object
alert(typeof 'foo')             // string
</code></pre>

<p><a href="http://jsfiddle.net/dJBmf/">http://jsfiddle.net/dJBmf/</a></p>

<p>This is breaking some things that expect a string, such as jQuery's <code>.text(str)</code> method.</p>

<p>Any clues?</p>
