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