The Aaron said: Illegal return statement happens when you have a return outside the scope of a function, at the global scope. It's very likely that you have an extra } somewhere above one of your return statements, something like: function foo() {
if( bar ) {
return baz;
} } // <- like this
return qux;
} If you throw your code in the Google Closure Compiler , it should find the issue for you pretty quickly. If you aren't editing your script in an editor set up for programming, you should probably look into doing that. Brace matching, syntax highlighting and built in linting can really help with syntax errors like this. Here's the thing - the code works in some instances and doesn't in others - specifically, some of this is code that is already up on one-click, and if I enable a local script and a one-click, things break this way - if I disable some of them selectively, it doesn't... (edited to add) - and it isn't consistent (which scripts are disabled changes, and there is no pattern to which one needs to be disabled and might be considered "the problem") ...and I had this crashing happening a lot earlier this week with a script that was of this pattern: var foo = foo||(function(){ var bar = function(){} return {bar:bar} })(); Edited again to add: I'm wondering if it's in the process that stuffs all the scripts together - something about how I write my scripts, it doesn't like. Something in how I write out the closures in the scripts in series is throwing the jam-everything-together script off when there's more than one.