Fix declaration emitter scoping issue for type parameter constraints

This commit is contained in:
Anders Hejlsberg 2015-12-10 13:55:57 -08:00
parent 3055445d27
commit 5ab5338574

View file

@ -1309,6 +1309,9 @@ namespace ts {
}
function emitSignatureDeclaration(node: SignatureDeclaration) {
const prevEnclosingDeclaration = enclosingDeclaration;
enclosingDeclaration = node;
// Construct signature or constructor type write new Signature
if (node.kind === SyntaxKind.ConstructSignature || node.kind === SyntaxKind.ConstructorType) {
write("new ");
@ -1321,9 +1324,6 @@ namespace ts {
write("(");
}
const prevEnclosingDeclaration = enclosingDeclaration;
enclosingDeclaration = node;
// Parameters
emitCommaList(node.parameters, emitParameterDeclaration);