doWrite method
Performs the write.
Implementation
@override
void doWrite(data, options, [callback]) {
// we must output valid javascript, not valid json
// see: http://timelessrepo.com/json-isnt-a-javascript-subset
var js = json
.encode(data)
.replaceAll(RegExp(r'\u2028'), '\\u2028')
.replaceAll(RegExp(r'\u2029'), '\\u2029');
// prepare response
data = head + js + foot;
super.doWrite(data, options, callback);
}