         type = attributes.type or defaulttype
         handler = 
           name: attributes.name
-          script: script
+          script: transformScript(script, type)
           args: args
-          type: type
 
         classattributes.$handlers.push(handler)
         # console.log 'added handler', attributes.name, script, attributes

        args = (attributes.args ? '').split()
        script = htmlDecode(child.innerHTML)
        type = attributes.type or defaulttype
        classattributes.$methods[attributes.name] = [script, args, type]
        # console.log 'added method', attributes.name, script, classattributes
      else if childname == 'setter'
        args = (attributes.args ? '').split()
        script = htmlDecode(child.innerHTML)
        type = attributes.type or defaulttype
        classattributes.$methods['set_' + attributes.name] = [script, args, type]
        # console.log 'added setter', 'set_' + attributes.name, args, classattributes.$methods
      else if childname == 'attribute'
        classattributes[attributes.name] = attributes.value

      for {name, script, args, type} in attributes.$handlers?
        name = name.substr(2)
        # console.log 'installing handler', name, args, type, script, @
        @bind(name, eventCallback(name, script, @, args))
      delete attributes.$handlers

      # Bind to event expressions and set attributes
