You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
556 B
JavaScript
23 lines
556 B
JavaScript
'use strict';
|
|
const {COMMENT_NODE} = require('../shared/constants.js');
|
|
const {VALUE} = require('../shared/symbols.js');
|
|
|
|
const {CharacterData} = require('./character-data.js');
|
|
|
|
/**
|
|
* @implements globalThis.Comment
|
|
*/
|
|
class Comment extends CharacterData {
|
|
constructor(ownerDocument, data = '') {
|
|
super(ownerDocument, '#comment', COMMENT_NODE, data);
|
|
}
|
|
|
|
cloneNode() {
|
|
const {ownerDocument, [VALUE]: data} = this;
|
|
return new Comment(ownerDocument, data);
|
|
}
|
|
|
|
toString() { return `<!--${this[VALUE]}-->`; }
|
|
}
|
|
exports.Comment = Comment
|