         # console.log 'applying overridden method', methodname, arguments
         supr.apply(scope, arguments)
         meth.apply(scope, arguments)
-      # console.log('overrode method', methodname, scope, supr, meth)
+        # console.log('overrode method', methodname, scope, supr, meth)
     else
       scope[methodname] = method
       # console.log('installed method', methodname, scope, scope[methodname])

    constructor: (el, attributes = {}) ->
      @subviews = []
      attributes.$types = {x: 'number', y: 'number', width: 'number', height: 'number', clickable: 'boolean'}
      if (el instanceof HTMLElement and el.$view)
        console.warn 'already bound view', el.$view, el
        return

      if (el instanceof View)
        el = el.sprite


  # generate a callback for an event expression in a way that preserves scope, e.g. on_x="console.log(value, this, ...)"
  eventCallback = (name, script, scope, fnargs=['value']) ->
    # console.log 'binding to event expression', name, script, scope, fnargs
    js = compileScript(script, fnargs)
    () ->
      if name of scope
        args = [scope[name]]
      else 
        args = arguments
        # console.log 'event callback', name, args, scope, js
        js.apply(scope, args)


