Skip to content

Playground: Add ability to stop a running script #2541

Description

When running some code in the playground, there is no way to stop the execution of a running program (a la Ctrl+C in the terminal). This can lead to some weird behaviour. For example, set an interval to log A to the console periodically and run the code. Changing the output to B causes A and B to both be output to the console.

image

Repro:

  1. Simply run the following line of code in the playground, and run the code.
let interval = setInterval(() => { console.log('A') }, 1000);
  1. Modify the code, and 'run' again:
let interval = setInterval(() => { console.log('B') }, 1000);

Expected behavior:
I expect only 'B' to be printed.
Actual behavior:
'B' and 'A' are being printed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PlaygroundIssues that affect the Playground

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions