angular / dgeni-packages

A collection of dgeni packages for generating documentation from source code.
MIT License
142 stars 106 forks source link

fix(typescript): do not throw if node does not have any comment #272

Closed devversion closed 6 years ago

devversion commented 6 years ago
petebacondarwin commented 6 years ago

I think we need to go one step further (including the result from getTrailingComments()), since both functions can actually return undefined. See https://github.com/Microsoft/TypeScript/blob/master/src/compiler/scanner.ts#L757

petebacondarwin commented 6 years ago

This is probably why I had that complicated concatenate function previously.

petebacondarwin commented 6 years ago

If we had strictNullChecks on I think the TS compiler would have caught this, no?

devversion commented 6 years ago

I think we need to go one step further (including the result from getTrailingComments()), since both functions can actually return undefined. See

Yeah, for those we already fall back to an empty array.

If we had strictNullChecks on I think the TS compiler would have caught this, no?

Not entirely sure. But it would be in general a good idea to enable it. But probably better for a follow-up PR because there might be more instances than just this PR?

petebacondarwin commented 6 years ago

Released as 0.26.7