An extraction of JS Bin's loop protection functionality.