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

Overly-generic syntax error messages #3

Open
jugglinmike opened this issue Dec 17, 2018 · 0 comments
Open

Overly-generic syntax error messages #3

jugglinmike opened this issue Dec 17, 2018 · 0 comments

Comments

@jugglinmike
Copy link
Owner

jugglinmike commented Dec 17, 2018

JSHint reports certain syntax errors with generic messages for the following conditions:

  • Constructors cannot be static methods
  • Constructors cannot be generator methods
  • Accessors cannot be generator methods
  • Duplicate constructor definition
  • super used outside of class literal
  • super used outside of object literal

Unlike the majority of invalid syntax, these cases can be described concisely in plain English. Doing so may help users more quickly identify and correct their mistake.

To limit the profusion of error codes, consider which of these distinctions can be expressed through error message parameterization.

Edit: Some of those conditions do not need new messages. There is no restriction on static methods named "constructor", and we've recently fixed the way super is handled, including better messages.

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

1 participant