title: JavaScript function aliasing doesn't seem to work
body: <p>I was just reading <a href="https://stackoverflow.com/questions/954417/make-alias-to-document-getelementbyid-in-javascript">this question</a> and wanted to try the alias method rather than the function-wrapper method, but I couldn't seem to get it to work in either Firefox 3 or 3.5beta4, or Google Chrome, both in their debug windows and in a test web page.</p>
  
  <p>Firebug:</p>
  
  <pre><code>&gt;&gt;&gt; window.myAlias = document.getElementById
  function()
  &gt;&gt;&gt; myAlias('item1')
  &gt;&gt;&gt; window.myAlias('item1')
  &gt;&gt;&gt; document.getElementById('item1')
  &lt;div id="item1"&gt;
  </code></pre>
  
  <p>If I put it in a web page, the call to myAlias gives me this error:</p>
  
  <pre><code>uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: file:///[...snip...]/test.html :: &lt;TOP_LEVEL&gt; :: line 7" data: no]
  </code></pre>
  
  <p>Chrome (with >>>'s inserted for clarity):</p>
  
  <pre><code>&gt;&gt;&gt; window.myAlias = document.getElementById
  function getElementById() { [native code] }
  &gt;&gt;&gt; window.myAlias('item1')
  TypeError: Illegal invocation
  &gt;&gt;&gt; document.getElementById('item1')
  &lt;div id=?"item1"&gt;?
  </code></pre>
  
  <p>And in the test page, I get the same "Illegal invocation".</p>
  
  <p>Am I doing something wrong?  Can anyone else reproduce this?</p>
  
  <p>Also, oddly enough, I just tried and it works in IE8.</p>