denoland / deno_doc

Documentation generator for Deno
MIT License
253 stars 54 forks source link

fix(cli): fix stack overflow in Deno doc when namespace exports itself #599

Open MujahedSafaa opened 3 months ago

MujahedSafaa commented 3 months ago

This PR fixes: https://github.com/denoland/deno/issues/23711

When executing deno doc on a TypeScript file that contains a namespace exporting itself, like in this file example: https://gist.github.com/crowlKats/1f6ed084bbab0a10267df9ed31564599

export namespace test {
    export { test };
}

The program exits with the following error: thread 'main' has overflowed its stack error: process didn't exit successfully: target\debug\examples\ddoc.exe test3.d.ts (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

Solution: I added a check to see if the export is the same as the namespace and, if so, it ignores generating the DocNode for it.

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

MujahedSafaa commented 2 months ago

Thanks for the PR, but see the comments. Also, would you be able to sign the CLA?

I signed the CLA document