deno_doc icon indicating copy to clipboard operation
deno_doc copied to clipboard

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

Open MujahedSafaa opened this issue 1 year ago • 2 comments

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.

MujahedSafaa avatar Jun 05 '24 09:06 MujahedSafaa

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 05 '24 09:06 CLAassistant

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

I signed the CLA document

MujahedSafaa avatar Jun 20 '24 08:06 MujahedSafaa