Re: Proposal For A New Alternative Keyword To “this” For Classes

john larson johnlarsondev1 at gmail.com
Sat Mar 9 15:09:45 UTC 2019


Hi Bergi,

Thanks for your input. I believe that it would be a trivial task for
current static code analyzers to restrict usage of "this" for anyone opting
in to use this new keyword exclusively. But the same does not hold true for
other work-arounds such as arrow functions. And in addition to that, as you
mentioned, arrow functions might have their own problems. Wouldn't such an
alternative keyword be a good addition to our toolkit anyway?

Best Regards,
John

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Mar 9, 2019 at 5:18 PM Bergi <a.d.bergi at web.de> wrote:

> Hi John,
> I don't think we do need another keyword for this. People would forget
> to use that new keyword instead of using this, just like they currently
> forget to use arrow functions.
> That said, your desired "behind-the-scenes implementation" can already
> be achieved easily with the class fields proposal and an arrow function.
> However, [there are many problems with that
> approach](
> https://medium.com/@charpeni/arrow-functions-in-class-properties-might-not-be-as-great-as-we-think-3b3551c440b1
> )
> anyway.
>
> kind regards,
>   Bergi
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190309/50bc6eb1/attachment.html>


More information about the es-discuss mailing list