 # ----------------------------------------------------------------------------
 
 ###**
-# FunctionTransformer:
-# Yep
-###
-
-class FunctionTransformer extends TransformerBase
+# FunctionTransforms:
+# Reorders functions.
+#
+# * Moves function definitions (`function x(){}`) to the top of the scope and
+#   turns them into variable declarations (`x = -> ...`).
+#
+# * Moves named function expressions (`setTimeout(function tick(){})`) to the
+#   top of the scope.
+###
+
+class FunctionTransforms extends TransformerBase
   onScopeEnter: (scope, ctx) ->
     ctx.prebody = []
 

# ----------------------------------------------------------------------------

###
# Walker:
# Traverses a JavaScript AST.
#
#     class MyWalker extends Walker

  {code, ast, map}

js2coffee.transform = (ast, options = {}) ->
  FunctionTransforms.run(ast, options)
  OtherTransforms.run(ast, options)

js2coffee.codegen = (ast, options = {}) ->
  new Builder(ast, options).get()
