Ah, makes sense. Thanks! - Joe

*/#!/*JoePea

On Thu, Mar 29, 2018 at 9:53 PM, Rob Brackett <[email protected]> wrote:

> Why is it that the static version you implemented above can `.apply`
> itself without this same error (and `new` is not being used)?
>
>
> Wow, this is old stuff! Anyway, it’s because it never calls the built-in
> `apply` on itself:
>
> ```
> class FunctionInheritable {
>   //…other bits omitted…
>
>   static apply(context, args) {
>     // this calls `apply` on `_constructor`, which is a function, not
> `constructor`, which is a class constructor
>     return this.prototype._constructor.apply(context, args) || context;
>   }
> }
> ```
>
> -Rob
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to