123456789101112131415161718192021222324252627282930313233 |
- import Node from '../core/Node.js';
- class ConvertNode extends Node {
- constructor( node, convertTo ) {
- super();
- this.node = node;
- this.convertTo = convertTo;
- }
- getNodeType( /*builder*/ ) {
- return this.convertTo;
- }
- generate( builder ) {
- const convertTo = this.convertTo;
- const convertToSnippet = builder.getType( convertTo );
- const nodeSnippet = this.node.build( builder, convertTo );
- return `${ convertToSnippet }( ${ nodeSnippet } )`;
- }
- }
- export default ConvertNode;
|