name anonymous functions on property assignments

T.J. Crowder tj.crowder at
Tue Dec 13 09:03:40 UTC 2016

About a year ago, Bergi asked[1] why no name is assigned to a function
when it's created as part of an assignment to an object property:

o.method = () => { };

Allen Wirfs-Brock replied:

> We did not have consensus on doing the same for:
> `MemberExpression.IdentifierName = FunctionExpression` or
> `MemberExpression[Expression] = FunctionExpression`
> so it is not part of ES2015. There were various objections that would have
> to be overcome before we could adopt that.

Does anyone remember what the objections were?

I've been through the TC39 meeting notes[2] without luck (so far). In
the May 28 2015 notes I can find "function name property" listed as an
open issue, but nothing in the May 29 notes and those are the last two
in the "es6" folder. Other than those, searching for "function name"
in meeting notes turns up Mar 24 2015, then Nov 18 2014, then July 23
2013; that last one talks about doing inference (as a whole) and AWB
says "It's not an insignificant amount of work" suggesting to me that
at that point, it hadn't been done yet. But Nov 18 2014 and Mar 24
2015 don't seem to address this case. Other mentions of "function
name" are unrelated (for instance, relate to `toString`). Searching
for "MemberExpression" only turns up one unrelated match.

The strawman[3] (linked from the July 23 2013 notes) does have the
name being set in this case (it's the final example).




More information about the es-discuss mailing list