Khan / Khan/live-editor

Infinite loop freezes up browser; doesn't display loop protector error

Open
#465 7 comments 0 reactions 0 assignees View on GitHub
bug pjs regressionbug
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

Reported in ZenDesk.

Students code locks up browser (Chrome) instead of showing infinite loop error.

The code was:

```
background(219, 255, 255);

//roof
fill(174, 180, 214);
triangle(200, 28, 350, 150, 50, 150);
//actual house
fill(209, 181, 157);
rect(60, 150, 280, 207);
//door
fill(120, 80, 19);
rect(180, 280, 40, 77);
//window
fill(255, 255, 255);

for (var i = 90; i < 400; i+20){
var x = 90;
rect(x, 190, 50, 70);
x += 100;
}

//grass and short trees
var x = 0;
var grass = getImage("cute/GrassBlock");
var tree = getImage("cute/TreeShort");
while (x < 400) {
image(grass, x, 303);
image(tree, x, 288);
x += 100;
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the supplied loop in the browser-based live editor and inspect the loop-protection path. Confirm how this code bypasses the protector; done means the browser remains responsive and displays the infinite-loop error instead of freezing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.