jscript

How to use the jscript transformer.

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

Usage

require("babel").transform("code", { optional: ["jscript"] });
$ babel --optional jscript script.js

Example

In

var foo = function bar() {

};

Out

"use strict";

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

  return bar;
})();