UNPKG

uhtml

Version:
30 lines (24 loc) • 517 B
'use strict'; const Node = (require('./node.js')); const { nodeName, value } = require('./symbols.js'); module.exports = class CharacterData extends Node { constructor(type, name, data, owner) { super(type, owner)[nodeName] = name; this.data = data; } get data() { return this[value]; } set data(any) { this[value] = String(any); } get nodeName() { return this[nodeName]; } get textContent() { return this.data; } set textContent(data) { this.data = data; } }