The most common case is the “methods” are designed to be used as constructors.
This has always be recognized for built-in methods in the ECMAScript
specification which says: "Built-in function objects that are not identified
[in this specification] as constructors do not implement the [[Construct]]
internal method unless otherwise specified in the description of a particular
function.”. When “concise methods” where add as part of Object Initializers
and Class Definitinos this default was applied to them.
You can still define constructible properties for Object Initializers, just not
by using concise method syntax:
```js
let classes = {
Cat: function() {},
Dog: function() {},
Bird: class {}
};
let [c, d, b] = [new classes.Cat, new classes.Dog, new classes.Bird];
```
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss