}
// Create it, and set the params.
//
SourceInfo fnSourceInfo = makeSourceInfo(fnNode);
JsFunction toFn = new JsFunction(fnSourceInfo, getScope(), toFnName);
// Creating a function also creates a new scope, which we push onto
// the scope stack.
//
pushScope(toFn.getScope(), fnSourceInfo);
while (fromParamNode != null) {
String fromParamName = fromParamNode.getString();
// should this be unique? I think not since you can have dup args.
JsName paramName = toFn.getScope().declareName(fromParamName);
toFn.getParameters().add(new JsParameter(fnSourceInfo, paramName));
fromParamNode = fromParamNode.getNext();
}
// Map the function's body.
//
JsBlock toBody = mapBlock(fromBodyNode);
toFn.setBody(toBody);
// Pop the new function's scope off of the scope stack.
//
popScope();