1 | "use strict";
|
2 | module.exports = DocumentType;
|
3 |
|
4 | var Node = require('./Node');
|
5 | var Leaf = require('./Leaf');
|
6 | var utils = require('./utils');
|
7 | var ChildNode = require('./ChildNode');
|
8 |
|
9 | function DocumentType(name, publicId, systemId) {
|
10 | Leaf.call(this);
|
11 |
|
12 |
|
13 | this.nodeType = Node.DOCUMENT_TYPE_NODE;
|
14 | this.ownerDocument = null;
|
15 | this.name = name;
|
16 | this.publicId = publicId || "";
|
17 | this.systemId = systemId || "";
|
18 | }
|
19 |
|
20 | DocumentType.prototype = Object.create(Leaf.prototype, {
|
21 | nodeName: { get: function() { return this.name; }},
|
22 | nodeValue: {
|
23 | get: function() { return null; },
|
24 | set: function() {}
|
25 | },
|
26 |
|
27 |
|
28 | clone: { value: function clone() {
|
29 | utils.DataCloneError();
|
30 | }},
|
31 |
|
32 | isEqual: { value: function isEqual(n) {
|
33 | return this.name === n.name &&
|
34 | this.publicId === n.publicId &&
|
35 | this.systemId === n.systemId;
|
36 | }}
|
37 | });
|
38 |
|
39 | Object.defineProperties(DocumentType.prototype, ChildNode);
|