a.d.bergi at web.de (2015-07-25T14:22:59.000Z)
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150725/6c8bc495/attachment.html>
forbes at lindesay.co.uk (2017-01-08T05:32:15.841Z)
Currently, unnamed function (and class) definitions that are part of a variable assignment or property definition are automatically given the name of the target identifier (see http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation and http://www.ecma-international.org/ecma-262/6.0/#sec-object-initializer-runtime-semantics-propertydefinitionevaluation). Same thing happens for (destructuring) default initialisers and variable initialisers.

However, if a function (or class) definition is assigned to a property of an object, this doesn't happen:

```js
var o = {};
o.someProperty = function() { … };
o.otherProperty = class { … };
```

I don't see any reason for not doing this, it just seems to be advantageous and make the language more consistent. I'm quite sure it wouldn't break any compatibility.

This would only require a minor change to section 12.3.1.4 <http://www.ecma-international.org/ecma-262/6.0/#sec-static-semantics-static-semantics-isidentifierref>, namely making `IsIdentifierRef` for

MemberExpression:  
MemberExpression [ Expression ]  
MemberExpression . IdentifierName  

return `true`.

(where it currently yields `false`). Everything else had already been abstracted out enough :-)

What do you think, can we fix this? Do I need to make a more explicit proposal?