artdaq_node_server  v1_00_09
 All Classes Namespaces Files Variables Pages
XMLCData.js
1 // Generated by CoffeeScript 1.10.0
2 (function() {
3  var XMLCData, XMLNode,
4  extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
5  hasProp = {}.hasOwnProperty;
6 
7  XMLNode = require('./XMLNode');
8 
9  module.exports = XMLCData = (function(superClass) {
10  extend(XMLCData, superClass);
11 
12  function XMLCData(parent, text) {
13  XMLCData.__super__.constructor.call(this, parent);
14  if (text == null) {
15  throw new Error("Missing CDATA text");
16  }
17  this.text = this.stringify.cdata(text);
18  }
19 
20  XMLCData.prototype.clone = function() {
21  return Object.create(this);
22  };
23 
24  XMLCData.prototype.toString = function(options) {
25  return this.options.writer.set(options).cdata(this);
26  };
27 
28  return XMLCData;
29 
30  })(XMLNode);
31 
32 }).call(this);