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 232278 - Getting bogus "Invalid left hand side for assignment" message
Summary: Getting bogus "Invalid left hand side for assignment" message
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P1 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-04 16:58 UTC by richpri
Modified: 2017-12-18 16:53 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description richpri 2013-07-04 16:58:06 UTC
I upgraded to NetBeans 7.3.1 and the new release is flagging some lines as
errors that were not so flagged in release 7.2. The flagged code turns out 
to be a feature that works in JavaScript 1.7. This feature is called "Destructuring Assignment". It is discussed here:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7?redirectlocale=en-US&redirectslug=JavaScript%2FNew_in_JavaScript%2F1.7#Destructuring_assignment_%28Merge_into_own_page.2Fsection%29

For example in the code:

  var xPix, yPix, index;
  [xPix, yPix] = offsetIn(event, BD18.canvas3); 
  
The second line gets flagged as an error with the message "Invalid left hand side for assignment".

Can I turn off this "Invalid left hand side for assignment" error flag for 
the above code?

I looked in options->hints but I found nothing that looked applicable. 

If there is no feature to control this error message, then one should be 
implemented ASAP because Destructuring Assignment will soon become more
prevalently supported by modern browsers.
Comment 1 Vladimir Riha 2013-07-04 20:10:26 UTC
Reproducible in trunk
Comment 2 Petr Pisl 2013-07-17 12:43:29 UTC
The error is from js parser (Nashorn). The proper fix should be push Nashorn implement this.
Comment 3 dusty 2017-12-18 16:53:57 UTC
This seems fixed in 8.2, please close the bug