obsoleting the "new" keyword

Mark S. Miller erights at google.com
Wed Jan 14 09:40:57 PST 2009

On Wed, Jan 14, 2009 at 9:19 AM, Peter Michaux <petermichaux at gmail.com>wrote:

> The requirement that JavaScript needed to look like Java has long been
> lamented. One of the key "looks" was the "new" keyword.  Many people
> don't like the use of the "new" keyword. Although "new" is here to
> stay, could we obsolete it when using a class sugar?

I agree. For *all* the desugaring of classes I've posted, the constructor is
merely a function, not using "this", that constructs are returns a new
instance. Thus, you get the same effect whether "new" is used on these or
not. Both "Point(3, 5)" and "new Point(3, 5)" return the same thing.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20090114/ead723f3/attachment.html>

More information about the Es-discuss mailing list