 		else s + repeat(s, n-1)
 
 extend = (o, p) ->
-	o ?= {}
+	o or= {}
 	for k of p
 		o[k] = p[k]
 	return o
+
+property = (o, k, props) ->
+	Object.defineProperty o, k, extend({
+		enumerable: true
+		configurable: true
+	}, props)
 
 class Event
 	@CAPTURING_PHASE = 1
 	@AT_TARGET = 2
 	@BUBBLING_PHASE = 3
-	constructor: () ->
+	constructor: ->
 		@type = null
 		@target = null
 		@currentTarget = null

			super a...
}

Element::__defineGetter__ 'tagName', () -> @nodeName
Element::__defineGetter__ 'innerHTML', () ->
	h = []
	for c in @childNodes
		h.push c.toString()
	return h.join('')
Element::__defineSetter__ 'innerHTML', (v) ->
	fragment = htmlparse(v, @ownerDocument)
	for c in @childNodes
		c._private.parentNode = null
		c._private.childIndex = -1
	@childNodes.length = 0
	@appendChild fragment

getInnerText = () ->
	t = []
	for c in @childNodes
		if c.nodeType in [Node.TEXT_NODE, Node.CDATA_SECTION_NODE]

	dispatchEvent: (evt) ->
		prevented = false
		stopped = false
		evt.preventDefault = ->
			if evt.cancelable
				prevented = true
		evt.stopPropagation = ->
			stopped = true
		evt.target = @
		# compute the chain of capturing nodes
