The latest ES6 draft introduced the notion of a concise function body
and it is being used for arrow functions as well as for methods and
set/get accessors.

Grammar:

ConciseBody :
  [lookahead does not include { ] AssignmentExpression
  { FunctionBody }

Example:

var object = {
  get x() this._x,
  set x(v) this._x = v,
  method() this._x
};

I don't remember us ever discussing this change?

Personally I think it makes things more consistent since concise
function bodies are allowed in ArrowFunction but I've heard people
complain about it already.

p.s. Allen, the spec draft has a bunch of ConsiseBody typos.

-- 
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to