swc_ecma_compat_es3

Function property_literals

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

babel: transform-property-literals

§Input

var foo = {
  // changed
  "bar": function () {},
  "1": function () {},

  // not changed
  "default": 1,
  [a]: 2,
  foo: 1
};

§Output

var foo = {
  bar: function () {},
  1: function () {},

  "default": 1,
  [a]: 2,
  foo: 1
};