     else if isEvent(name)
       element["on#{name}"] = value
     else
-      update = (newValue) ->
-        element.setAttribute name, newValue
-
       bindObservable(element, value, update)
 
     return element

  observeAttribute = (name, value) ->
    element = top()

    if (name is "value") and (typeof value is "function")
      element.value = value()

      element.onchange = ->
        value(element.value)

      if value.observe
        value.observe (newValue) ->
          element.value = newValue
    # Straight up onclicks, etc.
    else if name.match(/^on/) and isEvent(name.substr(2))
      element[name] = value

isFragment = (node) ->
  node.nodeType is 11

valueBind = (element, value) ->
  element.value = value()

  # Because firing twice with the same value is idempotent just binding both
  # oninput and onchange handles the widest range of inputs and browser
  # inconsistencies.
  element.oninput = ->
    value(element.value)
  element.onchange = ->
    value(element.value)

  value.observe? (newValue) ->
    element.value = newValue

  switch element.nodeName
    when "SELECT"
      # HACK: Need to set the value, but probably don't have the option contents yet
      # so let's just do it after our execution suspends and we probably have them
      setTimeout ->
        element.value = value()
      , 0

  return

Runtime = (context) ->
  stack = []

