Closed amrishpatidar96 closed 3 years ago
Dear @amrishpatidar96,
we're sorry to hear this.
May I ask some clarifying questions?
I'm thinking about how we could stop an infinite loop from happening …
after few minutes of running . nothing works on that component(online editor).
why do we not have button for handling such scenarios . because i use this editor while learning , to play with given examples on mdn website . so some time it happen that it does not stop like in my case. and whatever write from few minutes . i have to lose that code in that condition . let 's i can write the code again 20 to 25 line code is not big deal but it will not be a userfriendly . the website should not stuck and not become ir-responsive because of user action .
i am not advance developer but still i can tell you way to stop happening it . whenever user clicks on "run" button. and you can set a setTimeOut(handlingFunctionReference,10000) . and if it exceeds more than 10 seconds than you can show a popup and say that your program is taking too long "do you want to continue or stop" and if user clicks on stop you can stop it . and it will not get into infinite loop and also our page will not become irresponsive . because no one will write such a code that takes more time than 10 sec except settimeOut and timeRelated function . in this editor atleast . and if they write than we are showing popup or warning so still if they want to continue they can .
Ah, okay. So you're learning with an interactive example. That's cool!
The infinite-loop bug should likely be reported in https://github.com/mdn/interactive-examples/issues as well. I haven't looked into how they set up the execution.
It was discussed and they decided it's not worth implementing something to tackle this
Thanks for the link, @avivmu. I'm closing this as Won't Fix then. I'm sorry, @amrishpatidar96
because my computer memory get filled up by that infinite loop and browser say not responding . and there is not button in your editor for stopping it . so even it stuck in infinite loop we can stop the program. and over code persist in editor . there is reset button but in this case i loose whatever the code that i have written in editor.