 			ret[r++] = c.toString pretty, deep
 		return ret.join('')
 
-DocumentFragment::__defineSetter__ 'parentNode', (v) ->
-	throw Error "DocumentFragment cannot have a parentNode"
+property DocumentFragment::, 'parentNode',
+	set: (v) -> throw Error "DocumentFragment cannot have a parentNode"
 
 class Document extends Element
 	constructor: (a...) ->

	write: NotSupported
	writeln: NotSupported

exports.createDocument = () ->
	new HTMLDocument()

exports.registerGlobals = (g) ->

	createCDATASection: (value) -> new CData(value, @)
	createComment: (value) -> new Comment(value, @)
	createCComment: (value) -> new CComment(value, @)
	createDocumentFragment: -> new DocumentFragment(@)
	createElement: (name) ->
		nodeClass = ELEMENT_MAP[name?.toLowerCase()]
		if not nodeClass?
