 tabComplete = ->
   promptText = controller.promptText()
   args = promptText.split /\s+/
-  getCompletions = (args) ->
-    if args.length is 1 then commandCompletions args[0]
-    else if args[0] is 'time' then getCompletions(args[1..])
-    else fileNameCompletions args[0], args
   prefix = longestCommmonPrefix(getCompletions(args))
   return if prefix == ''  # TODO: if we're tab-completing a blank, show all options
   # delete existing text so we can do case correction
   promptText = promptText.substr(0, promptText.length - util.last(args).length)
   controller.promptText(promptText + prefix)
 
+getCompletions = (args) ->
+  if args.length is 1 then commandCompletions args[0]
+  else if args[0] is 'time' then getCompletions(args[1..])
+  else fileNameCompletions args[0], args
+
 commandCompletions = (cmd) ->
-  (name for name, handler of commands when name.substr(0, cmd.length) is cmd)
+  (name for name of commands when name.substr(0, cmd.length) is cmd)
 
 fileNameCompletions = (cmd, args) ->
   validExtension = (fname) ->

          editor.getSession?().setValue("/*\n * Binary file: #{f.name}\n */")
        else
          editor.getSession?().setValue(e.target.result)
        $('#console').click() # click to restore focus)
      if isClass then reader.readAsBinaryString(f) else reader.readAsText(f)
    )
    for f in ev.target.files

      # than once is fine too
      editor = ace.edit('source')
      editor.setTheme 'ace/theme/twilight'
      if not args[0]? or args[0].split('.')[1] is 'java'
        JavaMode = require("ace/mode/java").Mode
        editor.getSession().setMode(new JavaMode)
      else
