You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JavaScript syntax verifier considers access to private static properties in class methods to be illegal.
JavaScript example:
class Example {
static #privateProperty = 'private example';
static publicProperty = 'public example';
constructor() {
alert(this.constructor.publicProperty);
alert(this.constructor.#privateProperty); // Considered to be illegal
}
}
new Example();
The alert uses the static properties of the class inside a class method.
Both the access to the publicProperty and the #privateProperty works when running the code (tested in Chrome, Edge, and Firefox), but the IntelliSense isn't aware of this syntax: It doesn't give any suggestions of possible values.
The editor considers the access to #privateProperty to be illegal, since it starts with a #.
The editor doesn't complain about the access to publicProperty since this kind of access has been allowed for ages.
VS Code version: Code 1.84.0 (d037ac076cee195194f93ce6fe2bdfe2969cc82d, 2023-11-01T11:29:04.398Z)
OS version: Windows_NT x64 10.0.19045
The text was updated successfully, but these errors were encountered:
Type: Bug
The JavaScript syntax verifier considers access to private static properties in class methods to be illegal.
JavaScript example:
The
alert
uses the static properties of the class inside a class method.Both the access to the
publicProperty
and the#privateProperty
works when running the code (tested in Chrome, Edge, and Firefox), but the IntelliSense isn't aware of this syntax: It doesn't give any suggestions of possible values.The editor considers the access to
#privateProperty
to be illegal, since it starts with a#
.The editor doesn't complain about the access to
publicProperty
since this kind of access has been allowed for ages.VS Code version: Code 1.84.0 (d037ac076cee195194f93ce6fe2bdfe2969cc82d, 2023-11-01T11:29:04.398Z)
OS version: Windows_NT x64 10.0.19045
The text was updated successfully, but these errors were encountered: