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 248991 - Syntax highlighting is corrupted if the built-in Function object is referenced anywhere in JavaScript
Summary: Syntax highlighting is corrupted if the built-in Function object is reference...
Status: RESOLVED WORKSFORME
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-28 22:53 UTC by code83
Modified: 2015-02-04 03:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (31.96 KB, text/plain)
2014-11-28 22:54 UTC, code83
Details
Screenshot of described behaviour (32.52 KB, image/png)
2014-11-28 23:02 UTC, code83
Details

Note You need to log in before you can comment on or make changes to this bug.
Description code83 2014-11-28 22:53:56 UTC
Product Version = NetBeans IDE 8.0.1 (Build 201408251540)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.25-b02

If the built-in 'Function' object is referenced anywhere within a JS file, some syntax highlighting in the file is corrupted.

Specifically, the first 8 characters (including opening curly brace) of any immediately-invoked function that returns a value that is assigned to a variable, are coloured magenta. This happens in code both before and after the point in the script at which 'Function' is accessed.

Additionally, if the cursor is on the line in which 'Function' is accessed, a warning tip appears: 'The global variable "Function" is not declared'. If the cursor is on the word 'Function' itself, the word is highlighted in beige and all instances of the wrongly coloured magenta text are highlighted beige too.

This happens both within a JS file in a project, and also within a standalone JS file that is not part of a project and with no project opened in the IDE.
Comment 1 code83 2014-11-28 22:54:02 UTC
Created attachment 150775 [details]
IDE log
Comment 2 code83 2014-11-28 23:02:45 UTC
Created attachment 150776 [details]
Screenshot of described behaviour
Comment 3 code83 2014-11-28 23:08:41 UTC
Please note, the 8 chars include the newline if there is one.

Also, perhaps only key words get coloured magenta - e.g. if the function begins "{ var num = 1;" 'num' is not coloured, even though it is partly within the 8 chars.
Comment 4 Vladimir Riha 2014-11-29 20:16:17 UTC
Thank you for reporting, reproducible in 8.0.2 however this seems to be fixed in Dev builds where the coloring works fine.


Product Version: NetBeans IDE Dev (Build web-main-1610-on-20141128)
Updates: Updates available
Java: 1.7.0_71; Java HotSpot(TM) 64-Bit Server VM 24.71-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_71-b14
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; en_US (nb)
Comment 5 Quality Engineering 2015-02-04 03:23:09 UTC
*** Bug 249206 has been marked as a duplicate of this bug. ***