     classes = @ast.classes
     if @attributeClasses
       classes = classes.concat(value) for own _, value of @attributeClasses
-    classes = classes.concat(@boundClasses) if @boundClasses?.length
+    classes = classes.concat(@boundClasses.toArray()) if @boundClasses?.length
     classes.sort()
     if classes.length
       assignUnlessEqual(@element, "className", classes.join(' '))

    @children or []

  bindEvent: (event, fun) ->
    @boundEvents or= []
    if event
      @boundEvents.push({ event, fun })
      event.bind(fun)

  unbindEvent: (event, fun) ->
    @boundEvents or= []
    if event
      @boundEvents.splice(@boundEvents.indexOf(fun), 1)
      event.unbind(fun)

  detach: ->

  constructor: (@ast, @element) ->

  addBoundClass: (className) ->
    @boundClasses or= new Collection()
    unless @boundClasses?.includes(className)
      @boundClasses.push(className)
      @updateClass()

  removeBoundClass: (className) ->
    if @boundClasses
      index = @boundClasses.indexOf(className)
      @boundClasses.delete(className)
      @updateClass()

  setAttributeClasses: (name="__self__", value) ->
    @attributeClasses or= {}
