fix: guard against re-entrant event emissions by devvaannsh · Pull Request #2691 · phcode-dev/phoenix
Issue: https://github.com/orgs/phcode-dev/discussions/2685
Reason: Phoenix Code sometimes freezes immediately on startup (most likely only on Windows). This is likely caused by multiple focus events firing during startup, which results in the same event being emitted again while it is still being processed, leading to infinite recursion and a “Maximum call stack size exceeded” error.
Fix: Added a re-entry guard in EventEmitter.js where we track active events and block any re-entrant emission of the same event while it is already being processed.