mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-25 16:07:52 -05:00
Use comments from host variable declaration when exporting a signature in js declarations (#37594)
This commit is contained in:
@@ -6132,7 +6132,8 @@ namespace ts {
|
||||
// Each overload becomes a separate function declaration, in order
|
||||
const decl = signatureToSignatureDeclarationHelper(sig, SyntaxKind.FunctionDeclaration, context, includePrivateSymbol, bundled) as FunctionDeclaration;
|
||||
decl.name = createIdentifier(localName);
|
||||
addResult(setTextRange(decl, sig.declaration), modifierFlags);
|
||||
// for expressions assigned to `var`s, use the `var` as the text range
|
||||
addResult(setTextRange(decl, sig.declaration && isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags);
|
||||
}
|
||||
// Module symbol emit will take care of module-y members, provided it has exports
|
||||
if (!(symbol.flags & (SymbolFlags.ValueModule | SymbolFlags.NamespaceModule) && !!symbol.exports && !!symbol.exports.size)) {
|
||||
|
||||
Reference in New Issue
Block a user