Ensure that reserved words are quoted in object property keys
In
var foo = { catch: function () {} };
Out
var foo = { "catch": function () {} };
npm install --save-dev babel-plugin-transform-es3-property-literals
.babelrc
(Recommended).babelrc
{ "plugins": ["transform-es3-property-literals"] }
babel --plugins transform-es3-property-literals script.js
require("babel-core").transform("code", { plugins: ["transform-es3-property-literals"] });
© 2018 Sebastian McKenzie
Licensed under the MIT License.
http://babeljs.io/docs/plugins/transform-es3-property-literals/