Skip to content

Commit c5ef44e

Browse files
authored
StackNode: Fix outputNode flow propagation (#33405)
1 parent 2381d22 commit c5ef44e

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/nodes/core/StackNode.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,19 @@ class StackNode extends Node {
9191

9292
getElementType( builder ) {
9393

94-
return this.hasOutput( builder ) ? this.outputNode.getElementType( builder ) : 'void';
94+
return this.outputNode ? this.outputNode.getElementType( builder ) : 'void';
9595

9696
}
9797

9898
generateNodeType( builder ) {
9999

100-
return this.hasOutput( builder ) ? this.outputNode.getNodeType( builder ) : 'void';
100+
return this.outputNode ? this.outputNode.getNodeType( builder ) : 'void';
101101

102102
}
103103

104104
getMemberType( builder, name ) {
105105

106-
return this.hasOutput( builder ) ? this.outputNode.getMemberType( builder, name ) : 'void';
106+
return this.outputNode ? this.outputNode.getMemberType( builder, name ) : 'void';
107107

108108
}
109109

@@ -312,12 +312,6 @@ class StackNode extends Node {
312312

313313
}
314314

315-
hasOutput( builder ) {
316-
317-
return this.outputNode && this.outputNode.isNode && this.outputNode.getNodeType( builder ) !== 'void';
318-
319-
}
320-
321315
build( builder, ...params ) {
322316

323317
const previousStack = getCurrentStack();
@@ -393,9 +387,15 @@ class StackNode extends Node {
393387

394388
let result;
395389

396-
if ( this.hasOutput( builder ) ) {
390+
if ( this.outputNode ) {
397391

398-
result = this.outputNode.build( builder, ...params );
392+
const buildResult = this.outputNode.build( builder, ...params );
393+
394+
if ( builder.buildStage !== 'generate' || this.outputNode.getNodeType( builder ) !== 'void' ) {
395+
396+
result = buildResult;
397+
398+
}
399399

400400
} else {
401401

0 commit comments

Comments
 (0)