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

Inherited properties of custom Error incorrectly reported as static. #572

Closed
tomc974 opened this issue Jul 28, 2017 · 2 comments
Closed
Labels
bug Functionality does not match expectation

Comments

@tomc974
Copy link

tomc974 commented Jul 28, 2017

Hi!

I just noticed that if you create a custom Error, the inherited properties message, name and stack are reported by TypeDoc as being static while the TypeScript compiler correctly consider them as instance properties.

class CustomError extends Error {
}
@aciccarello
Copy link
Collaborator

@tomc974, I'll need to check to see that TypeDoc is listening to TypeScript correctly.

You'll probably want to look at this information on Extending built-ins for suggestions on how to correctly extend the Error object.

@aciccarello aciccarello added the bug Functionality does not match expectation label Jul 28, 2017
@aciccarello
Copy link
Collaborator

I've confirmed that TypeDoc is handling this differently than TypeScript.

function useError() {
  CustomError.stack; // [ts] Property 'stack' does not exist on type 'typeof CustomError'.  

  let errorInst = new CustomError();
  errorInst.stack; // ok
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants