Assert that enclosing declaration is not synthesized
This commit is contained in:
parent
aa59a69e14
commit
1f93526fd9
1 changed files with 3 additions and 0 deletions
|
@ -2444,18 +2444,21 @@ namespace ts {
|
|||
function createNodeBuilder() {
|
||||
return {
|
||||
typeToTypeNode: (type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags) => {
|
||||
Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & NodeFlags.Synthesized) === 0);
|
||||
const context = createNodeBuilderContext(enclosingDeclaration, flags);
|
||||
const resultingNode = typeToTypeNodeHelper(type, context);
|
||||
const result = context.encounteredError ? undefined : resultingNode;
|
||||
return result;
|
||||
},
|
||||
indexInfoToIndexSignatureDeclaration: (indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags) => {
|
||||
Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & NodeFlags.Synthesized) === 0);
|
||||
const context = createNodeBuilderContext(enclosingDeclaration, flags);
|
||||
const resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context);
|
||||
const result = context.encounteredError ? undefined : resultingNode;
|
||||
return result;
|
||||
},
|
||||
signatureToSignatureDeclaration: (signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags) => {
|
||||
Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & NodeFlags.Synthesized) === 0);
|
||||
const context = createNodeBuilderContext(enclosingDeclaration, flags);
|
||||
const resultingNode = signatureToSignatureDeclarationHelper(signature, kind, context);
|
||||
const result = context.encounteredError ? undefined : resultingNode;
|
||||
|
|
Loading…
Reference in a new issue