JScript transform

This transformer transforms named function expressions into function declarations to get around some particularly nasty JScript bugs related to name function expressions.

Example

In

var foo = function bar() {

};

Out

"use strict";

var foo = (function () {
  function bar() {}

  return bar;
})();

Installation

$ npm install babel-plugin-transform-jscript

Usage

Add the following line to your .babelrc file:

{
  "plugins": ["transform-jscript"]
}