function handleFunction(fn, scope, thisVal) {
  var localScope = fn.node && fn.node.getAnnotation("scope") ? fn.node.getAnnotation("scope") : new Scope(scope);
  localScope.declare('__return');
  if(fn.node) {
    fn.node.setAnnotation("scope", localScope);
    fn.node.rewrite('Function(name, fargs, body)', function(b) {
      b.fargs.forEach(function(farg) {
        localScope.declare(farg.value);
        localScope.hint(farg.value, new Value());
      });
      localScope.declare('__this');
      localScope.hint('__this', thisVal);
      inferAllTypes(localScope, b.body);
      return this;
    });
  } else if(fn.returnValue) {
    localScope.hint('__return', fn.returnValue);
  }
  return localScope;
}
Functions get two implicit variables: a __this variable and
a __return variable.