BypassNode.js 742 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import Node from './Node.js';
  2. import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
  3. class BypassNode extends Node {
  4. static get type() {
  5. return 'BypassNode';
  6. }
  7. constructor( returnNode, callNode ) {
  8. super();
  9. this.isBypassNode = true;
  10. this.outputNode = returnNode;
  11. this.callNode = callNode;
  12. }
  13. getNodeType( builder ) {
  14. return this.outputNode.getNodeType( builder );
  15. }
  16. generate( builder ) {
  17. const snippet = this.callNode.build( builder, 'void' );
  18. if ( snippet !== '' ) {
  19. builder.addLineFlowCode( snippet );
  20. }
  21. return this.outputNode.build( builder );
  22. }
  23. }
  24. export default BypassNode;
  25. export const bypass = /*@__PURE__*/ nodeProxy( BypassNode );
  26. addMethodChaining( 'bypass', bypass );
粤ICP备19079148号