Skip to content
Browse files

Add Loop Protect and Disable Code Auto-Run Articles

  • Loading branch information...
1 parent 6ba6030 commit 556ef9d1b6d604f81059cfcdac5700df661793df @SaintPeter SaintPeter committed
Showing with 21 additions and 0 deletions.
  1. +7 −0 Disable-Code-Auto-Run.md
  2. +14 −0 Loop-Protect.md
View
7 Disable-Code-Auto-Run.md
@@ -0,0 +1,7 @@
+By default, the Free Code Camp site automatically loads and runs your last recorded solution. If you have accidentally created an infinite loop or other irrecoverable error or simply don't trust the code, you can disable code auto-run by putting the following in your URL:
+`run=disabled`
+
+#### Example:
+URL: `http://www.freecodecamp.com/challenges/bonfire-meet-bonfire#?solution=function%20meetBonfire(argument)`
+
+No-Run URL: `http://www.freecodecamp.com/challenges/bonfire-meet-bonfire#?run=disabled&solution=function%20meetBonfire(argument)`
View
14 Loop-Protect.md
@@ -0,0 +1,14 @@
+The Free Code Camp code runner has a built in Infinite Loop Protect feature, leveraged from [JSBin's Loop Protect](https://github.com/jsbin/loop-protect). The loop protect injects some code into user created loops to allow a safe exit if more than ~500ms has passed without exiting the loop. Loop protect will catch many, but not all infinite loop issues.
+If you see this message:
+`Error: Potential infinite loop at line X`
+It means you have been protected from an infinite loop.
+**Note:** Loop Protect cannot detect infinite recursion.
+
+### Disable Loop Protect
+In some cases - a slow computer or a long loop - you may get an incorrect loop protect. In order to disable loop protect, add the following comment over the line the loop protection message lists:
+`//noprotect`
+
+**Warning:** Disabling loop protect means you may potentially allow your code to go into an infinite loop, causing your browser to be unresponsive.
+
+### Recovering Unresponsive Code
+If you have erred and incorrectly disabled loop protection and now have an unresponsive solution, you can [Disable Code Auto-Run](https://github.com/freecodecamp/freecodecamp/wiki/Disable-Code-Auto-Run).

0 comments on commit 556ef9d

Please sign in to comment.
Something went wrong with that request. Please try again.