This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE Dev (Build 201305292301) Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb) User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev 1. This code compiles fine: function method() { var test = { first: second, third: forth }; } 2. But this code is highlighted as an error: function method() { return { first: second, third: forth }; } 3. The error message is: test.js:6:8 Expected ; but found : third: forth ^ ---- (Alt-Enter shows hints) 4. I'm flagging this as a P2 because it is a regression for a fairly common use-case.
It is because of "{" of the object literal is on new line, following is OK function method() { return { first: second, third: forth }; } Does the your function actually work? I'm just curious because it doesn't for me in Chrome & Firefox and according to [1], there should be no line terminator between return keyword and value/statement [1] http://www.ecma-international.org/ecma-262/5.1/#sec-12.9
Wow, that's terrible :) Okay, in that case I would like Netbeans to provide a hint of what is wrong. Can you change the compiler error to "Newline not allowed between return and expression. See http://www.ecma-international.org/ecma-262/5.1/#sec-12.9"?
I filled enhancement for it and added you to CC (issue 230638). Thank you