Object literal methods and generator

# Herby Vojčík (14 years ago)

Hello!

In object literal, one can define method by method (args) { body } which is nice shortcut for 'method: function (args) { body },' with added value of method being non-enumerable. But there is no shortcut for 'gen: function* (args) { body },'.

What about extending the object literal notation with *method (args) { body } to define a generator method?

# Brendan Eich (14 years ago)

Yes, we talked about * before the name (after the imaginary 'function' keyword), see

esdiscuss/2011-October/017314