JSPM

  • Created
  • Published
  • Downloads 29366704
  • Score
    100M100P100Q258275F
  • License MIT

Ensure that no reserved words are used.

Package Exports

  • @babel/plugin-transform-reserved-words

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@babel/plugin-transform-reserved-words) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@babel/plugin-transform-reserved-words

Renames variables that are reserved words in ES3 but not ES5+

Some words were reserved in ES3 as potential future keywords but were not reserved in ES5 and later. This plugin, to be used when targeting ES3 environments, renames variables from that set of words.

Example

In

var abstract = 1;
var x = abstract + 1;

Out

var _abstract = 1;
var x = _abstract + 1;

Installation

npm install --save-dev @babel/plugin-transform-reserved-words

Usage

.babelrc

{
  "plugins": ["@babel/plugin-transform-reserved-words"]
}

Via CLI

babel --plugins @babel/plugin-transform-reserved-words script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-transform-reserved-words"]
});

References