Harman air - Null coalesce and nullish member access operators - WIP

This commit is contained in:
Jindra Petřík
2024-11-11 20:32:15 +01:00
parent 26cfb56291
commit f73f2669c0
45 changed files with 341 additions and 273 deletions

View File

@@ -3352,7 +3352,8 @@ public class Graph {
} else {
ternarOnFalse = filteredOnFalse.get(0).value;
}
stack.push(new TernarOpItem(null, localData.lineStartInstruction, expr.invert(null), ternarOnTrue, ternarOnFalse));
TernarOpItem top = new TernarOpItem(null, localData.lineStartInstruction, expr.invert(null), ternarOnTrue, ternarOnFalse);
stack.push(handleTernar(top, localData));
} else {
boolean isIf = true;
//If the ontrue is empty, switch ontrue and onfalse
@@ -4292,4 +4293,14 @@ public class Graph {
protected boolean partIsSwitch(GraphPart part) {
return false;
}
/**
* Replaces ternar with custom value
* @param ternar Ternar
* @param localData Local data
* @return Custom item
*/
protected GraphTargetItem handleTernar(TernarOpItem ternar, BaseLocalData localData) {
return ternar;
}
}