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 268581 - left sided post-increment in less-than comparison causes syntax error; character sequence ++<
Summary: left sided post-increment in less-than comparison causes syntax error; charac...
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-19 09:23 UTC by Elkano
Modified: 2017-01-21 03:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
file where the bug initially appeared for me (2.78 KB, application/x-javascript)
2016-10-19 09:23 UTC, Elkano
Details
minimal test case from ticket as file (48 bytes, text/javascript)
2016-10-19 09:26 UTC, Elkano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elkano 2016-10-19 09:23:34 UTC
Created attachment 162549 [details]
file where the bug initially appeared for me

After updating NetBeans from 8.1 to 8.2, a minified JS was marked as containing syntax errors. The file is part of the jQuery tablesorter plugin, version 2.23.4, and attached for further testing in case this isn't the only bug (although refactoring as described below cleared the syntax error).

Upon investigation, I was able to produce a minimal example for the bug in question:

var a,b,c,d;
if(a++<b)c='<span style="'+d+'">';
 
The second line will be annotated with:
- Unexpected character(s) "+d+" found
- Expected semicolon ; after "<b)c='<span style="'+d+'">';".

Splitting the sequence ++< with whitespace, e.g. a space "++ <", does not resolve the error.
Refactoring to e.g. "b>a++" does remove the annotations.

As mentioned before, this bug started with 8.2, the code is parsed fine in 8.1.

-----

Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_101; Java HotSpot(TM) 64-Bit Server VM 25.101-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_101-b13
System: Windows 10 version 10.0 running on amd64; Cp1252; de_DE (nb)
Comment 1 Elkano 2016-10-19 09:26:28 UTC
Created attachment 162550 [details]
minimal test case from ticket as file
Comment 2 Milutin Kristofic 2017-01-18 13:50:53 UTC
Thank you for minimal example.

It's now fixed in dev build by http://hg.netbeans.org/jet-main/rev/3c0100265992
Comment 3 Quality Engineering 2017-01-21 03:04:58 UTC
Integrated into 'main-silver', will be available in build *201701210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3c0100265992
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #268581 - left sided post-increment in less-than comparison causes syntax error; character sequence ++<