What is the difference between `newTarget` and `F` in abstract operation `Construct(..)` ?

Coolwust coolwust at gmail.com
Mon Mar 16 18:03:25 UTC 2015


Thanks very much for the explanation! it's clear now.

On Mon, Mar 16, 2015 at 1:58 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>
wrote:

>
> On Mar 16, 2015, at 10:32 AM, Coolwust wrote:
>
> From ES 6, section 7.3.14, there is an abstract operation `Construct (F,
> [argumentsList], [newTarget])`, so if I have the following code `var foo =
> new bar()`, then `newTarget` is the same as `F`, which is `bar`.
>
> My question is, in what situation, `F` is **NOT** the same as `newTarget`?
> And what is `newTarget` really?
>
>
> super() calls within constructors
>
> see
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-super-keyword-runtime-semantics-evaluation
>
> 3rd algorithm
>
> allen
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150316/c9a39fbc/attachment.html>


More information about the es-discuss mailing list