diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index d094d58ee..77c31ff15 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -814,8 +814,9 @@ export class BaseCompiler { if (!result) return false; - result.name = foundLib.name; - return result; + const copiedResult = structuredClone(result); + copiedResult.name = foundLib.name; + return copiedResult; } protected optionsForDemangler(filters?: ParseFiltersAndOutputOptions): string[] {