@typescript/native-preview 7.0.0-dev.20260624.1 → 7.0.0-dev.20260627.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { NodeFlags } from "#enums/nodeFlags";
3
3
  import { SyntaxKind } from "#enums/syntaxKind";
4
4
  import { TokenFlags } from "#enums/tokenFlags";
5
5
  import { getTokenPosOfNode } from "./astnav.js";
6
+ import { cloneSourceFileData } from "./utils.js";
6
7
  import { forEachChildOfJSDocParameterTag, forEachChildOfJSDocPropertyTag, } from "./visitor.js";
7
8
  export class NodeObject {
8
9
  kind;
@@ -821,7 +822,7 @@ function cloneNodeData(node) {
821
822
  case SyntaxKind.JSDocPropertyTag:
822
823
  return { tagName: n.tagName, name: n.name, isBracketed: n.isBracketed, typeExpression: n.typeExpression, isNameFirst: n.isNameFirst, comment: n.comment };
823
824
  case SyntaxKind.SourceFile:
824
- return { statements: n.statements, endOfFileToken: n.endOfFileToken, text: n.text, fileName: n.fileName, path: n.path };
825
+ return cloneSourceFileData(n);
825
826
  default:
826
827
  return undefined;
827
828
  }
@@ -3041,9 +3042,16 @@ export function createSourceFile(statements, endOfFileToken, text, fileName, pat
3041
3042
  path,
3042
3043
  });
3043
3044
  }
3045
+ function cloneSourceFileWithChanges(source, statements, endOfFileToken) {
3046
+ return new NodeObject(SyntaxKind.SourceFile, {
3047
+ ...cloneSourceFileData(source),
3048
+ statements: createNodeArray(statements),
3049
+ endOfFileToken,
3050
+ });
3051
+ }
3044
3052
  export function updateSourceFile(node, statements, endOfFileToken) {
3045
3053
  return node.statements !== statements || node.endOfFileToken !== endOfFileToken
3046
- ? createSourceFile(statements, endOfFileToken, node.text, node.fileName, node.path)
3054
+ ? cloneSourceFileWithChanges(node, statements, endOfFileToken)
3047
3055
  : node;
3048
3056
  }
3049
3057
  //# sourceMappingURL=factory.generated.js.map