Skip to content

14.13.1

@TomasVotruba TomasVotruba tagged this 29 Aug 17:45
Only flag a cheap guard for hoisting when the expensive-call anchor merely
captures the value (assignment) or bails on it (pure bail guard). An anchor with
its own side effects - an attribute-writing block, or a bare call statement that
mutates a variable by-reference inside a closure - is unsafe to hoist past, since
the nodes the guard bails out on would lose that side effect. Fixes false
positives on DowngradeSubstrFalsyRector and TypeWillReturnCallableArrowFunctionRector.

Claude-Session: https://claude.ai/code/session_01Na4eYvNqa2pdhZrBXbegrv
Assets 2
Loading