-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Documenting a class returning another class #1729
Comments
Constructors should not have a return statement, the purpose of the constructor is to CONSTRUCT the object not some other object. You should switch that to either extending the HTMLCanvasElement class or a creation type function returning the element. |
If the language allows it then it should be supported by jsdoc. |
There's a lot of valid JavaScript that shouldn't be valid. Just because you can do something doesn't mean you should. |
Oh just go away. I really don’t get why people feel the need to drive by and just drop comments for no good reason. This is valid JavaScript. I can use this in the language. I should be able to document it. Just because you done like certain ways of writing code doesn’t mean others should be prevented from doing so. |
No good reason? Besides explaining why it should not be implemented? Carry on being a child and disliking every comment I post lol. Perhaps you should learn to read and comprehend. In the simplest of terms, hacks are not supported or used by any reputable sources. Fork the project to add support for hacks. |
Taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new:
It's not common, but there are legitimate cases where one might return a different value in a constructor. As an example, one might want to return a Proxy object wrapping the value of |
Input code
Expected behavior
This is the js output, so I know this works.
Current behavior
This is what happens when using a jsdoc plugin and hover over the width.
I would have expected the width to show that it's a number.
The text was updated successfully, but these errors were encountered: