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 228919 - JavaScript else if formatting breaks syntax
Summary: JavaScript else if formatting breaks syntax
Status: RESOLVED DUPLICATE of bug 227781
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3
Hardware: PC Windows 8
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-23 23:17 UTC by ryannaddy
Modified: 2013-04-26 07:57 UTC (History)
1 user (show)

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 ryannaddy 2013-04-23 23:17:02 UTC
When doing auto formatting (Alt+Shift+F) on JavaScript code with an "else if" statement, the space between the two keywords is removed.

if(i == 1){
    // Do something
}else if(i == 2){
    // Do something else
}

After auto formatting it looks like this and it's an error:

if(i == 1){
    // Do something
}elseif(i == 2){
    // Do something else
}
Comment 1 Vladimir Riha 2013-04-24 05:59:14 UTC
Reproducible in 7.3 and trunk if one sets to JavaScript|Spaces -> Before Left Braces|Else to be unchecked



Product Version: NetBeans IDE 7.3 (Build 201302132200)
Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.2.0-40-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 Petr Hejl 2013-04-24 06:29:37 UTC

*** This bug has been marked as a duplicate of bug 227781 ***