If I try to execute a script whose only source line is an object:
it parses fine (in both V8 and UglifyJS). Similarly I can put a string or number on its own as source code and there is no syntax error reported.
However, both V8 and UglifyJS complain about this on its own:
Uncaught SyntaxError: Unexpected token (.
I realise declaring an anonymous function without executing it won't do anything; that's not the question. I want to know why it causes a parse error.