numbas / numbas/editor

Detect infinite loops in JavaScript and stop execution

Open
#532 2 comments 0 reactions 0 assignees View on GitHub
wishlist
Dominant language
JavaScript
Stars
60
Forks
62
PR merge metrics
No merged PRs in 30d

Description

For example, copying and pasting a for loop and editing the variables in order can lead to something like:

```
for (var i = 0; i < 2; i++) {
for (var j = 0; j < 2; i++) {
}
}
```

because the editor is saving changes as you type. This example causes an infinite loop it is hard to break from. Can this be situation detected and/or can some UI element help break from frozen scripts?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the nested JavaScript loop shown in the issue while editing and determine how script execution becomes unresponsive. No file, test, or entry point is named, so first locate the editor's JavaScript execution path. Done should include a defined way to detect or interrupt the loop and a usable recovery UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.