Unbound arrow functions?
andyearnshaw at gmail.com
Mon Jun 22 07:58:16 UTC 2015
The thing I liked about thin arrows (other than the conciseness) was the
lack of a prototype object, thus automatically throwing on construct and
having similar behaviour to native functions. Concise methods and fat
arrows already have this behaviour, but if you want to add such a method to
an already existing object you have to resort to using Object.assign (or
have a function with a prototype that is made to throw on construct).
Of course, if we made .prototype configurable for non-builtins we could
always delete to get the same behaviour. Not sure how viable that is, or
if it's worth it for such a minor convenience.
On Mon, 22 Jun 2015 at 01:07 Allen Wirfs-Brock <allen at wirfs-brock.com>
> On Jun 21, 2015, at 7:42 AM, Erik Arvidsson wrote:
> At one point in time we allowed concise bodies in classes and object
> literals but the commas in object literals made the syntax problematic.
> We also talked about the possibility of allow ; as an alternate separator
> in object literals. But it didn't find much traction.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss