mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
26 lines
454 B
JavaScript
26 lines
454 B
JavaScript
var VNode = require('./VNode');
|
|
var inherit = require('raptor-util/inherit');
|
|
|
|
function VText(value) {
|
|
this.$__VNode(-1 /* no children */);
|
|
this.nodeValue = value;
|
|
}
|
|
|
|
VText.prototype = {
|
|
$__Text: true,
|
|
|
|
nodeType: 3,
|
|
|
|
actualize: function(doc) {
|
|
return doc.createTextNode(this.nodeValue);
|
|
},
|
|
|
|
$__cloneNode: function() {
|
|
return new VText(this.nodeValue);
|
|
}
|
|
};
|
|
|
|
inherit(VText, VNode);
|
|
|
|
module.exports = VText;
|