Community
Participate
Working Groups
Build Identifier: I20110310-1119 The formatter adds a newline after a return statement if the next token starts with "{". This changes the semantics and results in invalid JavaScript code. Reproducible: Always Steps to Reproduce: 1. Set [Preferences] -> [JavaScript] -> [Code Style] -> [Formatter] -> [Edit...] -> [Braces] -> [Object initializer] to "Next line" 2. Formatting the following example code: test = function() { return { test : 1 }; } 3. results in the following invalid code: test = function() { return { test : 1 }; } After a return statement the "{" must always stay on the same line, no matter what the settings are.
Created attachment 193822 [details] force next token on the same line after a return statement The attached quick fix resolves the issue for me.
Chris, I have reviewed this patch and validated it resolves this problem. I recommend it to be included in 3.5.1. Could you officially complete this review?
Seems like a simple fix and does the job. Approved.
Markus, Eclipse is putting in some updated policies regarding accepting patches. See point #1 and #2 in the Bugzilla section at this link: http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions If you haven't yet, you need to sign the Contributor License Agreement for us to pull in your patch. Thanks, Chris