sub
Version:
A subset of the DOM environment for running Rule.js on the server
35 lines (27 loc) • 710 B
JavaScript
;
var Node = require('./Node').Node;
var createText = require('./Text').createText;
var createHTMLElement = require('./HTMLElement').createHTMLElement;
/*
* Document
*/
var Document;
Document = (function () {
// Extension
(function (child, parent) {
function Document() {
this.constructor = child;
}
Document.prototype = parent.prototype;
child.prototype = new Document();
}(Document, Node));
// Prototype
Document.prototype.createTextNode = createText;
Document.prototype.createElement = createHTMLElement;
// Constructor
function Document() {
throw new TypeError('Illegal constructor');
}
return Document;
}());
exports.Document = Document;