       if not @error
         d = Date.now()
         try
-          @javaScript = coffee.compile c, {bare: false}
+          @javaScript = coffee.compile c, {bare: true}
         catch e
           @error = new toffeeError @, errorTypes.COFFEE_COMPILE, e
         if @minimize and not @error


  _coffeeHeaders: ->
    ___  = @_tabAsSpaces()

    """
#{if @browserMode then '' else getCommonHeaders false, @autoEscape }
tmpl = toffee.templates["#{@bundlePath}"]  =
  bundlePath: "#{@bundlePath}"
tmpl.render = tmpl.pub = (__locals) ->
#{___}_to = (x) -> __locals.__toffee.out.push x
#{___}_ln = (x) -> __locals.__toffee.lineno = x
#{___}_ts = (x) -> __locals.__toffee.state  = x
#{___}toffee.__augmentLocals __locals, "#{@bundlePath}"

#{___}`with (__locals) {`
#{___}__toffee.out = []
"""

  _coffeeFooters: ->
    ___    = @_tabAsSpaces()
    """\n
#{___}__toffee.res = __toffee.out.join ""
#{___}return __toffee.res
#{___}`true; } /* closing JS 'with' */ `
# sometimes we want to execute the whole thing in a sandbox
# and just output results
if __toffee_run_input?
#{___}return tmpl.pub __toffee_run_input
"""

exports.view                = view
exports.getCommonHeaders    = getCommonHeaders


  include_bundle_headers: includes some functions needed for browser use
  ###
  __ = "  "
  """
#{__}if not toffee?            then toffee = {}
#{__}if not toffee.templates   then toffee.templates = {}
#{__}
#{__}toffee.states = #{JSON.stringify states}
#{__}
#{__}toffee.__json = (locals, o) ->
#{__}  if not o? then return "null"
#{__}  else return "" + JSON.stringify(o).replace(/</g,'\\\\u003C').replace(/>/g,'\\\\u003E').replace(/&/g,'\\\\u0026')
#{__}
#{__}toffee.__raw = (locals, o) -> o
#{__}
#{__}toffee.__html = (locals, o) ->
#{__}  (""+o).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;')
#{__}
#{__}toffee.__escape = (locals, o) ->
#{__}  if locals.__toffee.autoEscape? then ae = locals.__toffee.autoEscape
#{__}  else if #{auto_escape?}        then ae = #{auto_escape}
#{__}  else                                ae = true
#{__}  if ae
#{__}    if o is undefined then return ''
#{__}    if o? and (typeof o) is "object" then return locals.json o
#{__}    return locals.html o
#{__}  return o
#{__}
#{__}toffee.__augmentLocals = (locals, bundle_path) ->
#{__}  _l = locals
#{__}  _t = _l.__toffee = {out: []}
#{__}  if not _l.print?   then _l.print    = (o) -> toffee.__print   _l, o
#{__}  if not _l.json?    then _l.json     = (o) -> toffee.__json    _l, o
#{__}  if not _l.raw?     then _l.raw      = (o) -> toffee.__raw     _l, o
#{__}  if not _l.html?    then _l.html     = (o) -> toffee.__html    _l, o
#{__}  if not _l.escape?  then _l.escape   = (o) -> toffee.__escape  _l, o
#{__}  if not _l.partial? then _l.partial  = (path, vars) -> toffee.__partial toffee.templates["\#{bundle_path}"], _l, path, vars
#{__}  if not _l.snippet? then _l.snippet  = (path, vars) -> toffee.__snippet toffee.templates["\#{bundle_path}"], _l, path, vars
#{__}  _t.print   = _l.print
#{__}  _t.json    = _l.json
#{__}  _t.raw     = _l.raw
#{__}  _t.html    = _l.html
#{__}  _t.escape  = _l.escape
#{__}  _t.partial = _l.partial
#{__}  _t.snippet = _l.snippet
#{__}
#{__}#{if include_bundle_headers then getBundleHeaders() else ""}
#{__}"""

getBundleHeaders = ->
  ###
  header stuff
  only needed when compiling to a JS file
  ###
  __ = "  "
  """
#{__}toffee.__print = (locals, o) ->
#{__}  if locals.__toffee.state is toffee.states.COFFEE
#{__}    locals.__toffee.out.push o
#{__}    return ''
#{__}  else
#{__}    return "\#{o}"
#{__}
#{__}toffee.__normalize = (path) ->
#{__}  if (not path?) or path is "/"
#{__}    return path
#{__}  else
#{__}    parts = path.split "/"
#{__}    np = []
#{__}    # make sure path always starts with '/'
#{__}    if parts[0]
#{__}      np.push ''
#{__}    for part in parts
#{__}      if part is ".."
#{__}        if np.length > 1
#{__}          np.pop()
#{__}        else
#{__}          np.push part
#{__}      else
#{__}        if part isnt "."
#{__}          np.push part
#{__}    path = np.join "/"
#{__}    if not path then path = "/"
#{__}    return path
#{__}
#{__}toffee.__partial = (parent_tmpl, parent_locals, path, vars) ->
#{__}  path = toffee.__normalize parent_tmpl.bundlePath + "/../" + path
#{__}  return toffee.__inlineInclude path, vars, parent_locals
#{__}
#{__}toffee.__snippet = (parent_tmpl, parent_locals, path, vars) ->
#{__}  path = toffee.__normalize parent_tmpl.bundlePath + "/../" + path
#{__}  vars = if vars? then vars else {}
#{__}  vars.__toffee = vars.__toffee or {}
#{__}  vars.__toffee.noInheritance = true
#{__}  return toffee.__inlineInclude path, vars, parent_locals
#{__}
#{__}toffee.__inlineInclude = (path, locals, parent_locals) ->
#{__}  options                 = locals or {}
#{__}  options.__toffee        = options.__toffee or {}
#{__}
#{__}  # we need to make a shallow copy of parent variables
#{__}  if not options.__toffee.noInheritance
#{__}    for k,v of parent_locals when not locals?[k]?
#{__}      if not (k in ["print", "partial", "snippet", "layout", "__toffee"])
#{__}        options[k] = v
#{__}
#{__}  if not toffee.templates[path]
#{__}    return "Inline toffee include: Could not find \#{path}"
#{__}  else
#{__}    return toffee.templates[path].pub options
#{__}"""

getCommonHeadersJs = (include_bundle_headers, auto_escape, minimize)->
  ch = getCommonHeaders include_bundle_headers, auto_escape
