There is a nasty bug when using the option "New line before '{'"!
This breaks the code being formatted when there are any return statements which do return structured data!
E.g. "return {x:l, y:v}" will become
When loading something like this in Firefox there will be an "Uncaught SyntaxError: unexpected token: ':'" for the y-attribute. So, after the format we got an empty return-statement. Changing the code to at least
will fix this issue. But of course this is no solution to have to search for all broken return-statements after every JSFormat.
So there have to be an exception for opening braces after the keyword return!
There is a nasty bug when using the option "New line before '{'"!
This breaks the code being formatted when there are any return statements which do return structured data!
E.g. "return {x:l, y:v}" will become
When loading something like this in Firefox there will be an "Uncaught SyntaxError: unexpected token: ':'" for the y-attribute. So, after the format we got an empty return-statement. Changing the code to at least
will fix this issue. But of course this is no solution to have to search for all broken return-statements after every JSFormat.
So there have to be an exception for opening braces after the keyword return!