Function swc_ecma_compat_es2015::shorthand

source ·
pub fn shorthand() -> impl 'static + Fold + VisitMut
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;
   }
 };