You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
556 B

import Node from './node';
import NodeType from './type';
export default class CommentNode extends Node {
constructor(rawText) {
super();
this.rawText = rawText;
/**
* Node Type declaration.
* @type {Number}
*/
this.nodeType = NodeType.COMMENT_NODE;
}
/**
* Get unescaped text value of current node and its children.
* @return {string} text content
*/
get text() {
return this.rawText;
}
toString() {
return `<!--${this.rawText}-->`;
}
}