Skip to content

private mode #56171

Closed
Closed
@fsocietyCodeMaster

Description

@fsocietyCodeMaster

🔎 Search Terms

private property in a class

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

class Person {
private Name : string;
constructure(name : string){
this.Name = name
} }

🙁 Actual behavior

the problem is when we compile into javascript code in ES2022 we have # to make a property private and we cant get access to it
here in typescript even when we configure target to ES2022 , when we compile the above code in javascript file the privacy didnt applied and we can get access to the property and log it ,even the # doesnt appear

🙂 Expected behavior

in javascript we need to have the same result

Additional information about the issue

thanks you

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions