nuprl / Stopify

A JS-to-JS compiler that makes it easier to build Web IDEs and compile to JS.
https://zenodo.org/records/10408254
BSD 3-Clause "New" or "Revised" License
173 stars 12 forks source link

Fixes #481 #491

Closed arjunguha closed 3 years ago

arjunguha commented 3 years ago

@jpolitz I am going to merge in this patch. It fixes a bug in Stopify that @LeifAndersen identified (#481). I do not believe it breaks anything else. But, do look at the two unit tests that I've added -- one that still fails

The problem would arise when stopifying a var within a block or loop at the top-level. For various reasons, ElementaryJS does wraps the entire student code in a thunk, so student code would never update top-level variables, which is why this problem would never arise Ocelot.