>
>    *UnaryExpression* :
>            *class* *UnaryExpression*
>            ...
>
> The semantics are:
>  1. if *UnaryExpression* is undefined or null, return the value of *
> UnaryExpression*.
>  2. Let *obj* be ToObject(*UnaryExpression*)
> 3. Return the result of calling the [[Get]] internal method of *obj* with
> argument 'constructor'
>
>
> Interesting, so 'constructor' will inherit from Object.prototype if
> missing from the exemplar. This means
>
> let Point = class {
>      x:0,
>      y,0
> };
>
> let p = new Point(1, 2);
>
> will result in p being constructed via the equivalent of new Number(1).
>

When you create a function, it has an automatically created prototype
object who has a constructor property defaulted to the original function.

Why would it be bad to augment the UnaryExpression after the class keyword
so that it has an empty constructor if it doesn't exist?
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to