This is nothing but a simple conditional pattern for situations where you find yourself needing to test Javascript development code in a live operational server environment. Yes, this indicates less than ideal configuration management, but it has happened to me more than once. Reasons I can think of are:
- stoopid (quite often)
- need to authenticate against APIs, some of which can be difficult or impossible to set up in non-production environments
To make it work, you just have to set a custom User Agent prefix in your testing browser and change the string at the top of the file to match it. Customising User Agent strings varies between browsers but there are usually plugins available if it is not in the configuration options (for example, User Agent Switcher for Firefox).
Of course, syntax errors are going to kill the whole deal … :(