On Jun 9, 6:12 pm, David Marrs <[email protected]> wrote:
> On 9 Jun 2011 00:23, RobG <[email protected]> wrote:
>
> > On Jun 9, 2:34 am, David Marrs <[email protected]> wrote:
> > [...]
>
> > > [1] it actually passes the function F's special 'this' object, which
> > > in the above example is empty
>
> > A function's this keyword is never "empty", it *always* references an
> > object.
>
> Which, in the above example, is an empty object.  Or do you mean something
> else?

I misunderstood "empty" to mean nothing at all, rather than a new
instance of Object with no own properties (which is what it seems you
actually meant).

I think it would be clearer to paraphrase the spec and say that when a
function is called as a constructor with new its this keyword is set
to a new object whose [[prototype]] references the constructor's
prototype or, if that isn't Type Object, Object.prototype.


--
Rob

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to