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 244570 - Variable marked as unused in constructor and no property hint created.
Summary: Variable marked as unused in constructor and no property hint created.
Status: RESOLVED DUPLICATE of bug 223118
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-18 07:37 UTC by xracoonx
Modified: 2014-07-01 12:31 UTC (History)
0 users

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 xracoonx 2014-05-18 07:37:23 UTC
In the code below the variable 'hasWheels' is marked as being 'unused' in the constructor scope and no hint to the property is produced (e.g. when typing 'redCar.' outside of it).

function Car(color) {
    var hasWheels = true;
    this.color = color;
    this.hasWheels = hasWheels;
}

var redCar = new Car('red');
console.log(redCar.hasWheels);
Comment 1 Vladimir Riha 2014-05-19 07:19:36 UTC
reproducible in 8.0 and trunk
Comment 2 xracoonx 2014-05-19 20:24:18 UTC
By the way, this code which I think is equivalent works fine:

function Car(color) {
    var hasWheels = true;
    return {
        color: color,
        hasWheels: hasWheels
    };
}

var redCar = new Car('red');
console.log(redCar.hasWheels);
Comment 3 xracoonx 2014-05-19 21:01:06 UTC
However, it seems not to create any hints...
Comment 4 Vladimir Riha 2014-07-01 12:31:25 UTC

*** This bug has been marked as a duplicate of bug 223118 ***