fix: wrap okCode in else to prevent execution after error path
Success-exclusive code was emitted outside the if-else, so it ran even
when the call failed. Now it's wrapped in else { ... } — shared code
(blocks reachable from both error and success paths) stays outside.
This commit is contained in:
+3
-2
@@ -161,8 +161,9 @@
|
||||
Array.from(shared), new Set(), visited, isDecision, loopTargets
|
||||
);
|
||||
|
||||
var out = ifHeader + " {\n" + errCode + "}\n";
|
||||
if (okCode) out += okCode;
|
||||
var out = ifHeader + " {\n" + errCode + "}";
|
||||
if (okCode) out += " else {\n" + okCode + "}";
|
||||
out += "\n";
|
||||
if (sharedCode) out += sharedCode;
|
||||
return out;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user