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 262792 - [ES6] Add a hint to set a variable to const if there is no other assignment.
Summary: [ES6] Add a hint to set a variable to const if there is no other assignment.
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Other
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-13 09:02 UTC by Christian Lenz
Modified: 2017-05-23 13:18 UTC (History)
0 users

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 Christian Lenz 2016-07-13 09:02:16 UTC
In java we have this hint, if the compiler or whatever knows, that the private string member = "test"; that I declared, will never be assigned again, we got the message that we can make it final.

For var or let in JS it would be very nice, if the editor mechanism knows that the variable will never assigned again too and give me the hint: "Make variable const".


Regards

Chris
Comment 1 Petr Pisl 2016-07-13 09:17:05 UTC
Should not be hard to implement.
Comment 2 Christian Lenz 2017-05-23 13:18:49 UTC
So should not only be a hint, it should be a hint with a fix too.