JavaScript - behaviour of Function core object
<p>As far as I understand, in JavaScript (Gecko variant) this:</p>

<pre><code>var a = new A();
</code></pre>

<p>is a syntactic sugar for something like this:</p>

<pre><code>var a = {};
a.__proto__ = A.prototype;
A.call(a);
</code></pre>

<p>Because of that, <strong>A()</strong> (which is equivalent to <strong>A.call()</strong>?) and <strong>new A()</strong> should produce two different results, like these:</p>

<pre><code>&gt;&gt;&gt; new Date()
Fri Nov 19 2010 01:44:22 GMT+0100 (CET) {}
&gt;&gt;&gt; typeof new Date()
"object"

&gt;&gt;&gt; Date()
"Fri Nov 19 2010 01:44:42 GMT+0100 (CET)"
&gt;&gt;&gt; typeof Date()
"string"
</code></pre>

<p>So far so good.</p>

<p>But, core object <code>Function</code> behaves differently:</p>

<pre><code>&gt;&gt;&gt; Function('return 123;')
anonymous()
&gt;&gt;&gt; typeof Function('return 123;')
"function"
&gt;&gt;&gt; Function('return 123;')()
123
&gt;&gt;&gt; new Function('return 123;')
anonymous()
&gt;&gt;&gt; typeof new Function('return 123;')
"function"
&gt;&gt;&gt; new Function('return 123;')()
123
</code></pre>

<p>Am I missing some trivial thing here ?</p>
