Skip to content

Javascript private class variables error check #8953

@cclose1

Description

@cclose1

Apache NetBeans version

Apache NetBeans 27

What happened

Adding a duplicate private java script class variable causes a silent compilation failure.

Language / Project Type / NetBeans Component

Javascript

How to reproduce

Add following class to a js file

class Test {
  #var1;
  #var1;
}

Causes the js file containing it to not build without any error report. I had copied the variable meaning to change the copies name. Unfortunately I forgot to change the name and it took a long time to discover why. I accept having a private variable which duplicates another is an error, but surely it should fail the build with an error message.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11

JDK

Java EE 6 Web

Apache NetBeans packaging

Apache NetBeans platform

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Labels

JavaScript[ci] enable web job and extra JavaScript tests (webcommon/javascript2.editor)kind:featureA feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions