Skip to content

Find a way to detect endless loops #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CompuIves opened this issue Jul 13, 2017 · 4 comments · May be fixed by sitedata/codesandbox-client#3
Closed

Find a way to detect endless loops #50

CompuIves opened this issue Jul 13, 2017 · 4 comments · May be fixed by sitedata/codesandbox-client#3

Comments

@CompuIves
Copy link
Member

When a sandbox has an endless loop it won't stop executing until the tab kills the editor. This means that users can lose their sandbox.

Maybe there is a way to limit execution time of a sandbox, or maybe we should add a 'Run' button when you're editing your own sandbox. Would love to hear some thoughts.

@brumm
Copy link
Contributor

brumm commented Oct 12, 2017

@CompuIves
Copy link
Member Author

CompuIves commented Oct 12, 2017

Ah interesting! Just checked loop-protect and they've done a really great job, cool solution. Would be cool if we had something similar but then that it alters the AST, like a babel plugin. This is what I quickly found: https://www.npmjs.com/package/babel-plugin-looptar but I sploke with repl.it also and they built something for babel to solve it.

@CompuIves
Copy link
Member Author

Just found this https://repl.it/site/blog/infinite-loops, interesting as they are using a babel plugin as well.

@dbkaplun
Copy link

dbkaplun commented Mar 12, 2018

This is still a bug in the React TypeScript starter. To freeze your tab, open https://codesandbox.io/s/react-ts and type while (true) {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants