(node *ast.Node)
| 2344 | } |
| 2345 | |
| 2346 | func (b *Binder) bindOptionalChainFlow(node *ast.Node) { |
| 2347 | if isTopLevelLogicalExpression(node) { |
| 2348 | postExpressionLabel := b.createBranchLabel() |
| 2349 | saveCurrentFlow := b.currentFlow |
| 2350 | saveHasFlowEffects := b.hasFlowEffects |
| 2351 | b.bindOptionalChain(node, postExpressionLabel, postExpressionLabel) |
| 2352 | if b.hasFlowEffects { |
| 2353 | b.currentFlow = b.finishFlowLabel(postExpressionLabel) |
| 2354 | } else { |
| 2355 | b.currentFlow = saveCurrentFlow |
| 2356 | } |
| 2357 | b.hasFlowEffects = b.hasFlowEffects || saveHasFlowEffects |
| 2358 | } else { |
| 2359 | b.bindOptionalChain(node, b.currentTrueTarget, b.currentFalseTarget) |
| 2360 | } |
| 2361 | } |
| 2362 | |
| 2363 | func (b *Binder) bindOptionalChain(node *ast.Node, trueTarget *ast.FlowLabel, falseTarget *ast.FlowLabel) { |
| 2364 | // For an optional chain, we emulate the behavior of a logical expression: |
no test coverage detected