Sha256: 8bb8c3bce96747df154f671eb6aeb7f7827ae6b57fd5e375c6d79d308df644a8

Contents?: true

Size: 680 Bytes

Versions: 31

Compression:

Stored size: 680 Bytes

Contents

/* */ 
"format cjs";
/**
 * 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

31 entries across 31 versions & 1 rubygems

Version Path
sequenceserver-3.1.3 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-3.1.2 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-3.1.1 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-3.1.0 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-3.0.1 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-3.0 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.2.0 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.1.0 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc8 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc7 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc6 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc5 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc4 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc3 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc2 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.rc1 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.beta4 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.beta3 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js
sequenceserver-2.0.0.beta1 public/vendor/npm/babel-core@5.8.23/lib/transformation/transformers/es6/arrow-functions.js