Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private modifier for constructor #5539

Closed
dipacs opened this issue Nov 5, 2015 · 2 comments
Closed

private modifier for constructor #5539

dipacs opened this issue Nov 5, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@dipacs
Copy link

dipacs commented Nov 5, 2015

Sometimes the private modifier on the constructor can be useful, especially if you want to implement some kind of singletons.

@kitsonk
Copy link
Contributor

kitsonk commented Nov 5, 2015

What would the emit look like for this? Sounds like it would clearly break/not be compatible with ES6 classes. What would be the proposed behaviour on new? If you were creating a singleton, why not just an object literal using the ES6 notation?

const mySingleton = {
  foo() { console.log() }
};

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Nov 5, 2015
@DanielRosenwasser
Copy link
Member

Duplicate of #2341.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants