swc_ecma_compat_es2015

Function shorthand

source
pub fn shorthand() -> impl Pass
Expand description

Compile ES2015 shorthand properties to ES5

§Example

§In

var o = { a, b, c };

§Out

var o = { a: a, b: b, c: c };

§In

var cat = {
  getName() {
    return name;
  }
};

§Out

 var cat = {
   getName: function () {
     return name;
   }
 };