Normally what's done with script languages like JavaScript is to obfuscate the file by processing it with a tool that would rename everything to be meaningless, and change spacing, line breaks, etc in a way that is still executable, but overwhelmingly tedious/difficult for any human to read and understand.
Did they really ship the game with such open sourced code? For a company so concerned about preventing piracy, I find that pretty hard to believe. It's like they didn't even try.