Draw function is not reset when Restart is pressed
- Dominant language
- JavaScript
- Stars
- 776
- Forks
- 180
- PR merge metrics
- No merged PRs in 30d
Description
If you have a program that starts with no `draw` function defined, but later define one, then when you click Restart, the program will start with the draw function defined. I've made a simple demonstration:
https://www.khanacademy.org/computer-programming/spin-off-of-click-a-button-any-button/6142122579
The program starts without a `draw` function, just drawing some text. When you click it defines a `draw` function. If you press Restart, the program starts with the newly defined `draw` functions. This was confusing the creator of the code that I spun-off from into thinking the Restart button was broken.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked demonstration and trace the Restart control's program reset path, focusing on how the runtime handles a draw function created after startup. Done means pressing Restart returns to the original no-draw state rather than retaining the dynamically defined function.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100