You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "matthiasblaesing (via GitHub)" <gi...@apache.org> on 2025/11/20 17:35:18 UTC
[PR] JavaScript: Detect duplicate private class elements and invalid constructors [netbeans]
matthiasblaesing opened a new pull request, #9027:
URL: https://github.com/apache/netbeans/pull/9027
The JS parser should invalid constructs such as:
- Multiple declarations of constructor:
```javascript
class T {
constructor() {}
constructor() {}
}
```
- Private constructors:
```javascript
class T {
#constructor() {}
}
```
- Fields that are named constructor:
```javascript
class T {
constructor = X
}
```
- Generators named constructor:
```javascript
class T {
*constructor() {}
}
```
- Accessors named constructor:
```javascript
class S {
get constructor() {}
}
class T {
set constructor(value) {}
}
```
Private element must be declared only once:
- Accessor pair should be accepted
```javascript
class T {
get #X() {};
set #X(value) {};
}
```
- Reject plain field and and accessor
```javascript
class T {
#X = 1;
get #X() {};
}
```
```javascript
class T {
#X = 1;
set #X() {};
}
```
- Plain field and method should be rejected
```javascript
class T {
#X;
#X() {};
}
```
- Duplicate method should be rejected
```javascript
class T {
#X() {};
#X() {};
}
```
- Duplicate fields should be rejected
```javascript
class T {
#X;
#X;
}
```
- Mixed static declarations should be rejected
```javascript
class T {
get #X() {};
static set #X(value) {};
}
```
Closes: #8953
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] JavaScript: Detect duplicate private class elements and invalid constructors [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #9027:
URL: https://github.com/apache/netbeans/pull/9027#issuecomment-3618085307
Unless I get objects, I'll merge early next week.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] JavaScript: Detect duplicate private class elements and invalid constructors [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing merged PR #9027:
URL: https://github.com/apache/netbeans/pull/9027
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists