all files / vdom/ VComment.js

100% Statements 8/8
100% Branches 2/2
100% Functions 3/3
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17          936× 692× 244×        
import { document } from '../seed/core'
 
export function VComment(text) {
    this.nodeName = '#comment'
    this.nodeValue = text
}
VComment.prototype = {
    constructor: VComment,
    toDOM: function() {
        if (this.dom)
            return this.dom
        return this.dom = document.createComment(this.nodeValue)
    },
    toHTML: function() {
        return '<!--' + this.nodeValue + '-->'
    }
}