This commit is contained in:
2024-08-31 00:49:21 +02:00
parent eefa5f22b9
commit 0aa86922f7
56 changed files with 17694 additions and 1 deletions

37
node_modules/@mixmark-io/domino/Leaf.js generated vendored Normal file
View File

@ -0,0 +1,37 @@
"use strict";
module.exports = Leaf;
var Node = require('./Node');
var NodeList = require('./NodeList');
var utils = require('./utils');
var HierarchyRequestError = utils.HierarchyRequestError;
var NotFoundError = utils.NotFoundError;
// This class defines common functionality for node subtypes that
// can never have children
function Leaf() {
Node.call(this);
}
Leaf.prototype = Object.create(Node.prototype, {
hasChildNodes: { value: function() { return false; }},
firstChild: { value: null },
lastChild: { value: null },
insertBefore: { value: function(node, child) {
if (!node.nodeType) throw new TypeError('not a node');
HierarchyRequestError();
}},
replaceChild: { value: function(node, child) {
if (!node.nodeType) throw new TypeError('not a node');
HierarchyRequestError();
}},
removeChild: { value: function(node) {
if (!node.nodeType) throw new TypeError('not a node');
NotFoundError();
}},
removeChildren: { value: function() { /* no op */ }},
childNodes: { get: function() {
if (!this._childNodes) this._childNodes = new NodeList();
return this._childNodes;
}}
});