orep-js/sunpy/node/nodes/propertynode.js
2020-04-21 00:03:26 +02:00

22 lines
589 B
JavaScript

import { SwapNode } from "./swapnode.js";
import { PropertyReader } from "../propertyreader.js";
export class PropertyNode extends SwapNode {
constructor(node, swapNode, propertyReader) {
super(node, swapNode);
if (!(propertyReader instanceof PropertyReader))
throw TypeError("propertyReader must be an instance of PropertyReader");
this.propertyReader = propertyReader;
super.replaceNodes();
}
/**
* @override
*/
linker(node, swapNode) {
this.properties = this.propertyReader.read(node.innerText);
}
}