mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
When source file is redirected, set the prototype correctly in node factory (#48862)
Fixes #48039
This commit is contained in:
1 parent
d879880a37
commit
c8ec855f9f
4 files changed
+104
-1
No files matched your search
@@ -5275,7 +5275,7 @@ namespace ts {
|
||||
hasNoDefaultLib: boolean,
|
||||
libReferences: readonly FileReference[]
|
||||
) {
|
||||
const node = baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile) as Mutable<SourceFile>;
|
||||
const node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile)) as Mutable<SourceFile>;
|
||||
for (const p in source) {
|
||||
if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p)) continue;
|
||||
(node as any)[p] = (source as any)[p];
|
||||
|
||||
Reference in new issue
Block a user