All open typescript scratchpad's share the same namespace. This means they can read each other's variables. Defining x in two typescript scratchpads results in an error because it's already defined in the other scratchpad. I would like each typescript scratchpad to have its own namespace. Or, in other words, I think each scratchpad should run in its own sandbox.
I don't think scratchpads worked this way in the past so I'm assuming this is a bug? If it is intentional behavior, I'm happy to provide reasons for my feature request.
Steps to reproduce
Create a new Typescript scratchpad
Write const x = 1; as its content.
Create another new Typescript scratchpad
Write const x = 1; as its content.
Expected: Both scratchpad's exist without error
Actual: Both scratchpad's error:
Cannot redeclare block-scoped variable 'x'. ts(2451)
scratch34.ts(1, 7): 'x' was also declared here.
Note: Closing one of the two scratchpad's (or both) fixes the problem.
Summary
All open typescript scratchpad's share the same namespace. This means they can read each other's variables. Defining
x
in two typescript scratchpads results in an error because it's already defined in the other scratchpad. I would like each typescript scratchpad to have its own namespace. Or, in other words, I think each scratchpad should run in its own sandbox.I don't think scratchpads worked this way in the past so I'm assuming this is a bug? If it is intentional behavior, I'm happy to provide reasons for my feature request.
Steps to reproduce
const x = 1;
as its content.const x = 1;
as its content.Expected: Both scratchpad's exist without error Actual: Both scratchpad's error:
Note: Closing one of the two scratchpad's (or both) fixes the problem.