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

Member check incorrect when using new keyword #81

Open
joydeep-b opened this issue Oct 22, 2018 · 2 comments
Open

Member check incorrect when using new keyword #81

joydeep-b opened this issue Oct 22, 2018 · 2 comments

Comments

@joydeep-b
Copy link
Collaborator

This should not throw an error:

function MyClass() {
  this.x = 0;
}
let m = new MyClass();

But it results in:

object does not have member 'x' at Line 2: in MyClass
... : in handleNew
... 
@joydeep-b joydeep-b added the bug label Oct 22, 2018
@arjunguha
Copy link
Member

This is by design. I would prefer a better error message:

MyClass is not a constructor

@joydeep-b
Copy link
Collaborator Author

Good pun. Label updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants