XMLNamedNodeMap.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Generated by CoffeeScript 1.12.7
  2. (function() {
  3. var XMLNamedNodeMap;
  4. module.exports = XMLNamedNodeMap = (function() {
  5. function XMLNamedNodeMap(nodes) {
  6. this.nodes = nodes;
  7. }
  8. Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {
  9. get: function() {
  10. return Object.keys(this.nodes).length || 0;
  11. }
  12. });
  13. XMLNamedNodeMap.prototype.clone = function() {
  14. return this.nodes = null;
  15. };
  16. XMLNamedNodeMap.prototype.getNamedItem = function(name) {
  17. return this.nodes[name];
  18. };
  19. XMLNamedNodeMap.prototype.setNamedItem = function(node) {
  20. var oldNode;
  21. oldNode = this.nodes[node.nodeName];
  22. this.nodes[node.nodeName] = node;
  23. return oldNode || null;
  24. };
  25. XMLNamedNodeMap.prototype.removeNamedItem = function(name) {
  26. var oldNode;
  27. oldNode = this.nodes[name];
  28. delete this.nodes[name];
  29. return oldNode || null;
  30. };
  31. XMLNamedNodeMap.prototype.item = function(index) {
  32. return this.nodes[Object.keys(this.nodes)[index]] || null;
  33. };
  34. XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) {
  35. throw new Error("This DOM method is not implemented.");
  36. };
  37. XMLNamedNodeMap.prototype.setNamedItemNS = function(node) {
  38. throw new Error("This DOM method is not implemented.");
  39. };
  40. XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) {
  41. throw new Error("This DOM method is not implemented.");
  42. };
  43. return XMLNamedNodeMap;
  44. })();
  45. }).call(this);