node.js 384 B

123456789101112131415161718
  1. /**
  2. * Node Class as base class for TextNode and HTMLElement.
  3. */
  4. export default class Node {
  5. constructor(parentNode = null) {
  6. this.parentNode = parentNode;
  7. this.childNodes = [];
  8. }
  9. get innerText() {
  10. return this.rawText;
  11. }
  12. get textContent() {
  13. return this.rawText;
  14. }
  15. set textContent(val) {
  16. this.rawText = val;
  17. }
  18. }