Version
24.7.0
Platform
Linux hostname 6.14.11-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 10 16:24:16 UTC 2025 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
- Start an interactive REPL session
- Type
delete globalThis._ but don't press enter
- Backspace until the line is empty
- Type
globalThis and press enter
How often does it reproduce? Is there a required condition?
Reliably reproducible. The REPL preview needs to be enabled; it does not reproduce with TERM=dumb. Not reproducible with 22.18.0.
What is the expected behavior? Why is that the expected behavior?
I would expect that the delete expression doesn't actually cause any deletion during evaluation for the preview. Failing that, I would expect that _ (which initially doesn't exist) would be deleted from the global scope.
What do you see instead?
> globalThis
Uncaught ReferenceError: globalThis is not defined
The globalThis object is actually deleted.
Additional information
No response
Version
24.7.0
Platform
Subsystem
No response
What steps will reproduce the bug?
delete globalThis._but don't press enterglobalThisand press enterHow often does it reproduce? Is there a required condition?
Reliably reproducible. The REPL preview needs to be enabled; it does not reproduce with
TERM=dumb. Not reproducible with 22.18.0.What is the expected behavior? Why is that the expected behavior?
I would expect that the delete expression doesn't actually cause any deletion during evaluation for the preview. Failing that, I would expect that
_(which initially doesn't exist) would be deleted from the global scope.What do you see instead?
The
globalThisobject is actually deleted.Additional information
No response