src/property-chains.js
function parseFunction(link, index, expr) {
  var call = getFunctionCall(expr);

  // Always call functions in the scope of the object they're a member of
  if (index === 0) {
    link = addThisOrGlobal(link);
  } else {
    link = '_ref' + currentReference + link;
  }

  var calledLink = link + '(~~insideParens~~)';

  link = 'typeof ' + link + ' !== \'function\' ? void 0 : ' + calledLink;
  var insideParens = call.slice(1, -1);

  if (expr.charAt(propertyRegex.lastIndex) === '.') {
    currentReference = ++referenceCount;
    var ref = '_ref' + currentReference;
    link = '(' + ref + ' = (' + link + ')) == null ? void 0 : ';
  }

  var ref = currentReference;
  link = link.replace('~~insideParens~~', parsePropertyChains(insideParens));
  currentReference = ref;
  return link;
}
function parseFunction(link, index, expr) {
  var call = getFunctionCall(expr);

  // Always call functions in the scope of the object they're a member of
  if (index === 0) {
    link = addThisOrGlobal(link);
  } else {
    link = '_ref' + currentReference + link;
  }

  var calledLink = link + '(~~insideParens~~)';

  link = 'typeof ' + link + ' !== \'function\' ? void 0 : ' + calledLink;
  var insideParens = call.slice(1, -1);

  if (expr.charAt(propertyRegex.lastIndex) === '.') {
    currentReference = ++referenceCount;
    var ref = '_ref' + currentReference;
    link = '(' + ref + ' = (' + link + ')) == null ? void 0 : ';
  }

  var ref = currentReference;
  link = link.replace('~~insideParens~~', parsePropertyChains(insideParens));
  currentReference = ref;
  return link;
}
Handles a function to be called in its correct scope Finds the end of the function and processes the arguments