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.

Bug 228716 - Wrapping of empty objects
Summary: Wrapping of empty objects
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3.1
Hardware: All All
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-18 16:08 UTC by michael.virnstein
Modified: 2013-08-21 02:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description michael.virnstein 2013-04-18 16:08:40 UTC
If i set wrapping of objects to "If long", the first object property is kept on the same line as the curly brace. To move even the first properties on a separate line, i have to use "Always" for object wrapping. 
But if i do that, even empty objects are wrapped. So either we should have an option to choose, if we want emtpy objects to wrap or the behaviour should change to ignore empty objects:

Current:

var o = {
};

Expected:

var o = {};
Comment 1 Zicguy 2013-08-19 18:22:28 UTC
Hi everyone,
I currently have the same issue. I try to use this peace of source code:

stock = {};

For Netbeans, it is not a valid syntax. Using this one:

stock = {
};

resolve the issue... and of course I don't know why.

Thanks for taking this issue in account please.
Comment 2 Petr Hejl 2013-08-20 08:05:10 UTC
Fixed in web-main c72918f29136.
Comment 3 Quality Engineering 2013-08-21 02:45:38 UTC
Integrated into 'main-silver', will be available in build *201308202300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c72918f29136
User: Petr Hejl <phejl@netbeans.org>
Log: #228716 - Wrapping of empty objects