packages/regenerator-transform/src/visit.js
function getOuterFnExpr(funPath) {
  const t = util.getTypes();
  let node = funPath.node;
  t.assertFunction(node);

  if (!node.id) {
    // Default-exported function declarations, and function expressions may not
    // have a name to reference, so we explicitly add one.
    node.id = funPath.scope.parent.generateUidIdentifier("callee");
  }

  if (node.generator && // Non-generator functions don't need to be marked.
      t.isFunctionDeclaration(node)) {
    // Return the identifier returned by runtime.mark(<node.id>).
    return getMarkedFunctionId(funPath);
  }

  return t.clone(node.id);
}
function getOuterFnExpr(funPath) {
  const t = util.getTypes();
  let node = funPath.node;
  t.assertFunction(node);

  if (!node.id) {
    // Default-exported function declarations, and function expressions may not
    // have a name to reference, so we explicitly add one.
    node.id = funPath.scope.parent.generateUidIdentifier("callee");
  }

  if (node.generator && // Non-generator functions don't need to be marked.
      t.isFunctionDeclaration(node)) {
    // Return the identifier returned by runtime.mark(<node.id>).
    return getMarkedFunctionId(funPath);
  }

  return t.clone(node.id);
}
function getOuterFnExpr ( funPath ) { const t = util . getTypes ( ) ; let node = funPath . node ; t . assertFunction ( node ) ; if ( ! node . id ) { // Default-exported function declarations, and function expressions may not // have a name to reference, so we explicitly add one. node . id = funPath . scope . parent . generateUidIdentifier ( "callee" ) ; } if ( node . generator && // Non-generator functions don't need to be marked. t . isFunctionDeclaration ( node ) ) { // Return the identifier returned by runtime.mark(<node.id>). return getMarkedFunctionId ( funPath ) ; } return t . clone ( node . id ) ; }
Given a NodePath for a Function, return an Expression node that can be used to refer reliably to the function object from inside the function. This expression is essentially a replacement for arguments.callee, with the key advantage that it works in strict mode.
Given a NodePath for a Function return an Expression node that can be used to refer reliably to the function object from inside the function . This expression is essentially a replacement for arguments . callee with the key advantage that it works in strict mode .