ffd8 / P5LIVE

p5.js collaborative live-coding vj environment!
https://p5live.org
GNU General Public License v3.0
229 stars 35 forks source link

Adapt inifinite loop message to also include slow loop warning #65

Closed philomates closed 3 years ago

philomates commented 3 years ago

I got caught up today with the console error message Uncaught Infinite Loop! Check code and recompile... for code that wasn't executing infinitely, but instead executing for a long time.

This pull request changes the error to Uncaught Infinite or slow loop! Check code and recompile...

I would change it in the original https://github.com/popcodeorg/loop-breaker library but it P5LIVE pulls it in minified and adapts the error message they have

ffd8 commented 3 years ago

👋 @philomates – thanks for the PR and warning about the error message not being so helpful when it's simply slow to compile! Totally agree it needs to be changed.. and I'll definitely change it for the next release (adding instructions about how to override it, so one doesn't have to RTFM), something like : Preventing infinite/slow loop! Find bug or add '//noprotect' to override...

In P5LIVE, I disable console.logs that are the same (to avoid flooding it) – so this longer text would only appear once. closing this, since I should add this to the pre-minified/browserified version of this loop-protect

philomates commented 3 years ago

Nice, thanks!