mirror of
https://github.com/oven-sh/bun
synced 2026-03-01 13:01:06 +01:00
The REPL was converting all `const`/`let`/`var` declarations to `var` for persistence across evaluations, which allowed `const` variables to be silently reassigned. This fix preserves `const` semantics by keeping const declarations inside the IIFE and using Object.defineProperty with getter/setter to persist const bindings on globalThis as non-reassignable properties. Fixes #27485 Co-Authored-By: Claude <noreply@anthropic.com>