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 219803 - Valid code marked as invalid
Summary: Valid code marked as invalid
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-10 09:24 UTC by Vladimir Riha
Modified: 2012-10-12 11:51 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 Vladimir Riha 2012-10-10 09:24:36 UTC
Please try to copy&paste following in js file:

$?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;

The regular expression is not recognized (so it's not purple) and the code is marked as invalid. If you reformat it a bit (manually as autoformat does it incorrectly):

$?c.onreadystatechange=function(){
    /loaded|complete/.test(c.readyState)&&d()
}:c.onload=c.onerror=d;

Now it is okay. This snippet is extracted from minimized AngularJS

http://code.angularjs.org/1.0.2/angular.min.js

and thanks to this, the project as such has error badge


Product Version: NetBeans IDE Dev (Build 201210100002)
Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b03
System: Linux version 3.2.0-31-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Petr Hejl 2012-10-10 12:37:52 UTC
It might be a bug in the parser.
Comment 2 Petr Hejl 2012-10-10 14:03:21 UTC
It seems to be a bug in nashorn lexer. Should be fixed now in web-main: 985652656f27, d2fb8aaffff4 and 1d5be42e26cb.
Comment 3 Vladimir Riha 2012-10-12 11:51:04 UTC
Thanks, no error found and formatting works.


Product Version: NetBeans IDE Dev (Build 201210120002)
Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b03
System: Linux version 3.2.0-31-generic-pae running on i386; UTF-8; en_US (nb)