MCPcopy Create free account
hub / github.com/microsoft/typescript-go / copyFrom

Method copyFrom

internal/ast/ast.go:2659–2678  ·  view source on GitHub ↗
(other *SourceFile)

Source from the content-addressed store, hash-verified

2657}
2658
2659func (node *SourceFile) copyFrom(other *SourceFile) {
2660 // Do not copy fields set by NewSourceFile (Text, FileName, Path, or Statements)
2661 node.LanguageVariant = other.LanguageVariant
2662 node.ScriptKind = other.ScriptKind
2663 node.IsDeclarationFile = other.IsDeclarationFile
2664 node.ContainsNonASCII = other.ContainsNonASCII
2665 node.UsesUriStyleNodeCoreModules = other.UsesUriStyleNodeCoreModules
2666 node.Identifiers = other.Identifiers
2667 node.imports = other.imports
2668 node.ModuleAugmentations = other.ModuleAugmentations
2669 node.AmbientModuleNames = other.AmbientModuleNames
2670 node.CommentDirectives = other.CommentDirectives
2671 node.Pragmas = other.Pragmas
2672 node.ReferencedFiles = other.ReferencedFiles
2673 node.TypeReferenceDirectives = other.TypeReferenceDirectives
2674 node.LibReferenceDirectives = other.LibReferenceDirectives
2675 node.CommonJSModuleIndicator = other.CommonJSModuleIndicator
2676 node.ExternalModuleIndicator = other.ExternalModuleIndicator
2677 node.Flags |= other.Flags
2678}
2679
2680func (node *SourceFile) Clone(f NodeFactoryCoercible) *Node {
2681 updated := f.AsNodeFactory().NewSourceFile(node.parseOptions, node.text, node.Statements, node.EndOfFileToken)

Callers 2

CloneMethod · 0.45
UpdateSourceFileMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected