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