00001
00002 (function() {
00003 var XMLComment, XMLNode,
00004 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; },
00005 hasProp = {}.hasOwnProperty;
00006
00007 XMLNode = require('./XMLNode');
00008
00009 module.exports = XMLComment = (function(superClass) {
00010 extend(XMLComment, superClass);
00011
00012 function XMLComment(parent, text) {
00013 XMLComment.__super__.constructor.call(this, parent);
00014 if (text == null) {
00015 throw new Error("Missing comment text");
00016 }
00017 this.text = this.stringify.comment(text);
00018 }
00019
00020 XMLComment.prototype.clone = function() {
00021 return Object.create(this);
00022 };
00023
00024 XMLComment.prototype.toString = function(options) {
00025 return this.options.writer.set(options).comment(this);
00026 };
00027
00028 return XMLComment;
00029
00030 })(XMLNode);
00031
00032 }).call(this);