Handel assert for missing node kind in isDeclarationVisible for functionType and constructorType
This commit is contained in:
parent
d1bf508a7b
commit
9ed27b23ab
7 changed files with 107 additions and 0 deletions
|
@ -1617,7 +1617,9 @@ module ts {
|
|||
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.ConstructSignature:
|
||||
case SyntaxKind.ConstructorType:
|
||||
case SyntaxKind.CallSignature:
|
||||
case SyntaxKind.FunctionType:
|
||||
case SyntaxKind.IndexSignature:
|
||||
case SyntaxKind.Parameter:
|
||||
case SyntaxKind.ModuleBlock:
|
||||
|
|
22
tests/baselines/reference/constructorTypeDeclarations.js
Normal file
22
tests/baselines/reference/constructorTypeDeclarations.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
//// [constructorTypeDeclarations.ts]
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): new <T>(data: T) => T {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
//// [constructorTypeDeclarations.js]
|
||||
var schema;
|
||||
(function (_schema) {
|
||||
function createValidator(schema) {
|
||||
return undefined;
|
||||
}
|
||||
_schema.createValidator = createValidator;
|
||||
})(schema || (schema = {}));
|
||||
|
||||
|
||||
//// [constructorTypeDeclarations.d.ts]
|
||||
declare module schema {
|
||||
function createValidator(schema: any): new <T>(data: T) => T;
|
||||
}
|
17
tests/baselines/reference/constructorTypeDeclarations.types
Normal file
17
tests/baselines/reference/constructorTypeDeclarations.types
Normal file
|
@ -0,0 +1,17 @@
|
|||
=== tests/cases/compiler/constructorTypeDeclarations.ts ===
|
||||
|
||||
module schema {
|
||||
>schema : typeof schema
|
||||
|
||||
export function createValidator(schema: any): new <T>(data: T) => T {
|
||||
>createValidator : (schema: any) => new <T>(data: T) => T
|
||||
>schema : any
|
||||
>T : T
|
||||
>data : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return undefined;
|
||||
>undefined : undefined
|
||||
}
|
||||
}
|
26
tests/baselines/reference/functionTypeDeclarations.js
Normal file
26
tests/baselines/reference/functionTypeDeclarations.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
//// [functionTypeDeclarations.ts]
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): <T>(data: T) => T {
|
||||
return <T>(data: T) => {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// [functionTypeDeclarations.js]
|
||||
var schema;
|
||||
(function (_schema) {
|
||||
function createValidator(schema) {
|
||||
return function (data) {
|
||||
return data;
|
||||
};
|
||||
}
|
||||
_schema.createValidator = createValidator;
|
||||
})(schema || (schema = {}));
|
||||
|
||||
|
||||
//// [functionTypeDeclarations.d.ts]
|
||||
declare module schema {
|
||||
function createValidator(schema: any): <T>(data: T) => T;
|
||||
}
|
24
tests/baselines/reference/functionTypeDeclarations.types
Normal file
24
tests/baselines/reference/functionTypeDeclarations.types
Normal file
|
@ -0,0 +1,24 @@
|
|||
=== tests/cases/compiler/functionTypeDeclarations.ts ===
|
||||
|
||||
module schema {
|
||||
>schema : typeof schema
|
||||
|
||||
export function createValidator(schema: any): <T>(data: T) => T {
|
||||
>createValidator : (schema: any) => <T>(data: T) => T
|
||||
>schema : any
|
||||
>T : T
|
||||
>data : T
|
||||
>T : T
|
||||
>T : T
|
||||
|
||||
return <T>(data: T) => {
|
||||
><T>(data: T) => { return data; } : <T>(data: T) => T
|
||||
>T : T
|
||||
>data : T
|
||||
>T : T
|
||||
|
||||
return data;
|
||||
>data : T
|
||||
}
|
||||
}
|
||||
}
|
7
tests/cases/compiler/constructorTypeDeclarations.ts
Normal file
7
tests/cases/compiler/constructorTypeDeclarations.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
// @declaration: true
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): new <T>(data: T) => T {
|
||||
return undefined;
|
||||
}
|
||||
}
|
9
tests/cases/compiler/functionTypeDeclarations.ts
Normal file
9
tests/cases/compiler/functionTypeDeclarations.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
// @declaration: true
|
||||
|
||||
module schema {
|
||||
export function createValidator(schema: any): <T>(data: T) => T {
|
||||
return <T>(data: T) => {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue