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 246773 - Language: Javascript. Handling of Destructuring assignment as warning instead of error
Summary: Language: Javascript. Handling of Destructuring assignment as warning instead...
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Pisl
Depends on:
Reported: 2014-08-29 11:42 UTC by oriberu
Modified: 2014-11-05 15:57 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description oriberu 2014-08-29 11:42:28 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.8.0_20
Runtime = Java HotSpot(TM) Client VM 25.20-b23

It would be nice if Destructuring assignments (supported by Mozilla since 2006, example and link below) 
would at least not be marked as an error by the editor's hint system. A warning would probably be more 


[foo, bar] = "1,2".split(','); // foo=1, bar=2
[foo, bar] = "34"; // foo=3, bar=4
[foo, bar] = [5,6]; // foo=5, bar=6

[foo, bar] = "1,2,3".split(','); // foo=1, bar=2, discards 3
[foo,, bar] = "1,2,3".split(','); // foo=1, discards 2, bar=3

Comment 1 Petr Pisl 2014-11-05 15:57:06 UTC
This is problem of the Nashorn parser. We need to alter the parser itself or push Nashorn developer team to integrate this to the Nashorn.