Inspection, unresolved variable on this.* in javascript class Follow
Hi
I have a following class (in ES6).
class Foo {
constructor()
{
this._bar = '1';
}
foobar() {
this.e = this._bar; // this._bar is marked as unresolved variable
}
}
My problem is, that Webstorm marks this.bar in method foobar as unresolved variable.
The only solution that I've found is to mark the _bar as property, but I do not like that, since _bar should stay "private" and not to be displayed in documentation
/**
* @class Foo
* @property {string} _bar
*/
class Foo {
constructor()
{
this._bar = '1';
}
foobar() {
this.e = this._bar;
}
}
Please sign in to leave a comment.
Known issue, please vote for https://youtrack.jetbrains.com/issue/WEB-12808