   _selectedCellIndex = -1
   _clipboardCell = null
   _lastDeletedCell = null
-  _context = 
-    _results_: {}
-    _routines_: Flow.Routines _
+  _sandbox =
+    context: {}
+    routines: Flow.Routines _
+    results: {}
 
   _renderers =
     h1: -> Flow.HtmlTag _, 'h1'

      for declaration in declarations
        identifiers.push declaration
  indexBy identifiers, (identifier) -> identifier.name

isRedeclared = (stack, identifier) ->
  i = scopes.length
  while i--
    return true if scopes[i][identifier] 
  false

traverseJavascript = (parent, key, node, f) ->
  if isArray node

compileJavascript = (js, go) ->
  debug js
  try
    closure = new Function '_h2o_context_', '_h2o_routines_', '_h2o_results_', js
    go null, closure
  catch error
    go
      message: 'Error compiling javascript'
      cause: error

executeJavascript = (sandbox) ->
  (closure, go) ->
    try
      go null, closure sandbox.context, sandbox.routines, sandbox.results
    catch error
      go
        message: 'Error executing javascript'
        cause: error

Flow.Coffeescript = (_, sandbox) ->
  render: (guid, input, go) ->
    tasks = [
      safetyWrapCoffeescript guid
      compileCoffeescript
      parseJavascript
      createRootScope sandbox
      removeHoistedDeclarations
      rewriteJavascript
      generateJavascript
      compileJavascript
      executeJavascript sandbox
    ]
    (async tasks) input, (error, result) ->
      if error
        go error
      else
        debug sandbox
        go null,
          text: sandbox.results[guid]
          template: 'flow-raw'

Flow.Repl = (_) ->
