Sometimes dojo's error messages about syntax errors are really cryptic due to how dojo loads files via dojo.require(); however, you can get a better message by simply directly including the js file with the <script> tag.
There's also a lint program that Brian has recommended.