* Initial version * Replace .includes with .indexOf and better node set to visit * Alphabetically sort es3 reserved words and make difference helper for readability * Fix second Array.include error that was not polyfilled * Move es3 keywords into separate babel-types helper and use in all es3 transforms * Reference local plugin build directly for tests * Try relative import for babel-types * Update to scoped package name and beta 3 * Fix unscoped package import * Replace local plugin reference with proper plugin name
@babel/plugin-transform-es3-property-literals
Ensure that reserved words are quoted in object property keys
Example
In
var foo = {
catch: function () {}
};
Out
var foo = {
"catch": function () {}
};
Installation
npm install --save-dev @babel/plugin-transform-es3-property-literals
Usage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-es3-property-literals"]
}
Via CLI
babel --plugins transform-es3-property-literals script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["transform-es3-property-literals"]
});