Closed devversion closed 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
This is probably why I had that complicated concatenate
function previously.
If we had strictNullChecks
on I think the TS compiler would have caught this, no?
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?
Released as 0.26.7
getContent
for a node which does not have any leading comment, leads to a runtime exception.