|
@@ -41,11 +41,21 @@ class CondNode extends Node {
|
|
|
const type = this.getNodeType( builder );
|
|
|
const context = { tempWrite: false };
|
|
|
|
|
|
+ const nodeData = builder.getDataFromNode( this );
|
|
|
+
|
|
|
+ if ( nodeData.nodeProperty !== undefined ) {
|
|
|
+
|
|
|
+ return nodeData.nodeProperty;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
const { ifNode, elseNode } = this;
|
|
|
|
|
|
const needsOutput = output !== 'void';
|
|
|
const nodeProperty = needsOutput ? property( type ).build( builder ) : '';
|
|
|
|
|
|
+ nodeData.nodeProperty = nodeProperty;
|
|
|
+
|
|
|
const nodeSnippet = contextNode( this.condNode/*, context*/ ).build( builder, 'bool' );
|
|
|
|
|
|
builder.addFlowCode( `\n${ builder.tab }if ( ${ nodeSnippet } ) {\n\n` ).addFlowTab();
|