XMLCharacterData.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Generated by CoffeeScript 1.12.7
  2. (function() {
  3. var XMLCharacterData, 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. XMLNode = require('./XMLNode');
  7. module.exports = XMLCharacterData = (function(superClass) {
  8. extend(XMLCharacterData, superClass);
  9. function XMLCharacterData(parent) {
  10. XMLCharacterData.__super__.constructor.call(this, parent);
  11. this.value = '';
  12. }
  13. Object.defineProperty(XMLCharacterData.prototype, 'data', {
  14. get: function() {
  15. return this.value;
  16. },
  17. set: function(value) {
  18. return this.value = value || '';
  19. }
  20. });
  21. Object.defineProperty(XMLCharacterData.prototype, 'length', {
  22. get: function() {
  23. return this.value.length;
  24. }
  25. });
  26. Object.defineProperty(XMLCharacterData.prototype, 'textContent', {
  27. get: function() {
  28. return this.value;
  29. },
  30. set: function(value) {
  31. return this.value = value || '';
  32. }
  33. });
  34. XMLCharacterData.prototype.clone = function() {
  35. return Object.create(this);
  36. };
  37. XMLCharacterData.prototype.substringData = function(offset, count) {
  38. throw new Error("This DOM method is not implemented." + this.debugInfo());
  39. };
  40. XMLCharacterData.prototype.appendData = function(arg) {
  41. throw new Error("This DOM method is not implemented." + this.debugInfo());
  42. };
  43. XMLCharacterData.prototype.insertData = function(offset, arg) {
  44. throw new Error("This DOM method is not implemented." + this.debugInfo());
  45. };
  46. XMLCharacterData.prototype.deleteData = function(offset, count) {
  47. throw new Error("This DOM method is not implemented." + this.debugInfo());
  48. };
  49. XMLCharacterData.prototype.replaceData = function(offset, count, arg) {
  50. throw new Error("This DOM method is not implemented." + this.debugInfo());
  51. };
  52. XMLCharacterData.prototype.isEqualNode = function(node) {
  53. if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
  54. return false;
  55. }
  56. if (node.data !== this.data) {
  57. return false;
  58. }
  59. return true;
  60. };
  61. return XMLCharacterData;
  62. })(XMLNode);
  63. }).call(this);