babel/packages/babel-plugin-transform-es2015-block-scoping
Amjad Masad 30bb38c4bb Update scope binding info after transforming block-scoped bindings
When convert a const, let or any other block-bound binding to a var we
forget to update the scope info. This confuses other transforms that may
come after this as to which scope does the binding belongs to.

This also uncovered an issue where duplicate block-scoped bindings were allowed
to co-exist.
2016-03-01 17:03:06 -08:00
..
2016-02-29 16:12:12 -05:00
2015-09-15 06:12:46 +01:00

babel-plugin-transform-es2015-block-scoping

Compile ES2015 block scoping (const and let) to ES5

Installation

$ npm install babel-plugin-transform-es2015-block-scoping

Usage

.babelrc

{
  "plugins": ["transform-es2015-block-scoping"]
}

Via CLI

$ babel --plugins transform-es2015-block-scoping script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es2015-block-scoping"]
});