Sha256: 72701613987569ec98110c00e2139eee06f0fd04a5ae943b6eb868e6337f3261

Contents?: true

Size: 659 Bytes

Versions: 8

Compression:

Stored size: 659 Bytes

Contents

/**
 * Turn arrow functions into normal functions.
 *
 * @example
 *
 * **In**
 *
 * ```javascript
 * arr.map(x => x * x);
 * ```
 *
 * **Out**
 *
 * ```javascript
 * arr.map(function (x) {
 *   return x * x;
 * });
 */

"use strict";

exports.__esModule = true;
var visitor = {

  /**
   * Look for arrow functions and mark them as "shadow functions".
   * @see /transformation/transformers/internal/shadow-functions.js
   */

  ArrowFunctionExpression: function ArrowFunctionExpression(node) {
    this.ensureBlock();
    node.expression = false;
    node.type = "FunctionExpression";
    node.shadow = node.shadow || true;
  }
};
exports.visitor = visitor;

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
ilog-0.4.1 node_modules/babel/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
ilog-0.4.0 node_modules/babel/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
ilog-0.3.3 node_modules/babel/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/babel-core/lib/transformation/transformers/es6/arrow-functions.js