/third_party/typescript/tests/baselines/reference/ |
D | typeGuardConstructorClassAndNumber.js | 7 let var1: C1 | number; variable 8 if (var1.constructor == C1) { 9 var1; // C1 10 var1.property1; // string 13 var1; // number | C1 15 if (var1["constructor"] == C1) { 16 var1; // C1 17 var1.property1; // string 20 var1; // number | C1 22 if (var1.constructor === C1) { [all …]
|
D | typeGuardConstructorClassAndNumber.types | 10 let var1: C1 | number; 11 >var1 : number | C1 13 if (var1.constructor == C1) { 14 >var1.constructor == C1 : boolean 15 >var1.constructor : Function 16 >var1 : number | C1 20 var1; // C1 21 >var1 : C1 23 var1.property1; // string 24 >var1.property1 : string [all …]
|
D | typeGuardConstructorClassAndNumber.symbols | 10 let var1: C1 | number; 11 >var1 : Symbol(var1, Decl(typeGuardConstructorClassAndNumber.ts, 5, 3)) 14 if (var1.constructor == C1) { 15 >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) 16 >var1 : Symbol(var1, Decl(typeGuardConstructorClassAndNumber.ts, 5, 3)) 20 var1; // C1 21 >var1 : Symbol(var1, Decl(typeGuardConstructorClassAndNumber.ts, 5, 3)) 23 var1.property1; // string 24 >var1.property1 : Symbol(C1.property1, Decl(typeGuardConstructorClassAndNumber.ts, 1, 10)) 25 >var1 : Symbol(var1, Decl(typeGuardConstructorClassAndNumber.ts, 5, 3)) [all …]
|
D | typeGuardConstructorNarrowAny.types | 3 let var1: any; 4 >var1 : any 6 if (var1.constructor === String) { 7 >var1.constructor === String : boolean 8 >var1.constructor : any 9 >var1 : any 13 var1; // String 14 >var1 : String 16 if (var1.constructor === Number) { 17 >var1.constructor === Number : boolean [all …]
|
D | typeGuardConstructorNarrowAny.js | 3 let var1: any; variable 5 if (var1.constructor === String) { 6 var1; // String 8 if (var1.constructor === Number) { 9 var1; // Number 11 if (var1.constructor === Boolean) { 12 var1; // Boolean 14 if (var1.constructor === Array) { 15 var1; // any[] 17 if (var1.constructor === Symbol) { [all …]
|
D | typeGuardConstructorClassAndNumber.errors.txt | 25 let var1: C1 | number; 26 if (var1.constructor == C1) { 27 var1; // C1 28 var1.property1; // string 31 var1; // number | C1 33 if (var1["constructor"] == C1) { 34 var1; // C1 35 var1.property1; // string 38 var1; // number | C1 40 if (var1.constructor === C1) { [all …]
|
D | typeGuardConstructorNarrowAny.symbols | 3 let var1: any; 4 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) 6 if (var1.constructor === String) { 7 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) 10 var1; // String 11 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) 13 if (var1.constructor === Number) { 14 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) 17 var1; // Number 18 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowAny.ts, 1, 3)) [all …]
|
D | typeGuardConstructorPrimitiveTypes.js | 3 let var1: string | number | boolean | any[] | symbol | bigint; variable 4 if (var1.constructor === String) { 5 var1; // string 7 if (var1.constructor === Number) { 8 var1; // number 10 if (var1.constructor === Boolean) { 11 var1; // boolean 13 if (var1.constructor === Array) { 14 var1; // any[] 16 if (var1.constructor === Symbol) { [all …]
|
D | typeGuardsInClassAccessors.types | 12 var var1: string | number; 13 >var1 : string | number 23 num = typeof var1 === "string" && var1.length; // string 24 >num = typeof var1 === "string" && var1.length : number 26 >typeof var1 === "string" && var1.length : number 27 >typeof var1 === "string" : boolean 28 >typeof var1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "fu… 29 >var1 : string | number 31 >var1.length : number 32 >var1 : string [all …]
|
D | typeGuardConstructorPrimitiveTypes.types | 3 let var1: string | number | boolean | any[] | symbol | bigint; 4 >var1 : string | number | bigint | boolean | symbol | any[] 6 if (var1.constructor === String) { 7 >var1.constructor === String : boolean 8 >var1.constructor : Function 9 >var1 : string | number | bigint | boolean | symbol | any[] 13 var1; // string 14 >var1 : string 16 if (var1.constructor === Number) { 17 >var1.constructor === Number : boolean [all …]
|
D | typeGuardsInClassAccessors.js | 8 var var1: string | number; variable 13 num = typeof var1 === "string" && var1.length; // string 24 num = typeof var1 === "string" && var1.length; // string 36 num = typeof var1 === "string" && var1.length; // string 47 num = typeof var1 === "string" && var1.length; // string 59 num = typeof var1 === "string" && var1.length; // string 70 num = typeof var1 === "string" && var1.length; // string 82 num = typeof var1 === "string" && var1.length; // string 93 num = typeof var1 === "string" && var1.length; // string 111 var var1; variable [all …]
|
D | typeGuardConstructorNarrowPrimitivesInUnion.types | 3 let var1: number | "hello" | "world" | true | false | number[] | string[]; 4 >var1 : number | boolean | "hello" | "world" | number[] | string[] 8 if (var1.constructor === Number) { 9 >var1.constructor === Number : boolean 10 >var1.constructor : Function 11 >var1 : number | boolean | "hello" | "world" | number[] | string[] 15 var1; // number 16 >var1 : number 19 if (var1.constructor === String) { 20 >var1.constructor === String : boolean [all …]
|
D | typeGuardConstructorNarrowPrimitivesInUnion.symbols | 3 let var1: number | "hello" | "world" | true | false | number[] | string[]; 4 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowPrimitivesInUnion.ts, 1, 3)) 6 if (var1.constructor === Number) { 7 >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) 8 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowPrimitivesInUnion.ts, 1, 3)) 12 var1; // number 13 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowPrimitivesInUnion.ts, 1, 3)) 16 if (var1.constructor === String) { 17 >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) 18 >var1 : Symbol(var1, Decl(typeGuardConstructorNarrowPrimitivesInUnion.ts, 1, 3)) [all …]
|
D | typeGuardConstructorNarrowPrimitivesInUnion.js | 3 let var1: number | "hello" | "world" | true | false | number[] | string[]; variable 5 if (var1.constructor === Number) { 6 var1; // number 9 if (var1.constructor === String) { 10 var1; // "hello" | "world" 13 if (var1.constructor === Boolean) { 14 var1; // boolean 17 if (var1.constructor === Array) { 18 var1; // number[] | string[] 24 var var1; variable [all …]
|
D | typeGuardsInClassMethods.types | 9 var var1: string | number; 10 >var1 : string | number 19 num = typeof var1 === "string" && var1.length; // string 20 >num = typeof var1 === "string" && var1.length : number 22 >typeof var1 === "string" && var1.length : number 23 >typeof var1 === "string" : boolean 24 >typeof var1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "fu… 25 >var1 : string | number 27 >var1.length : number 28 >var1 : string [all …]
|
D | typeGuardsInClassMethods.js | 7 var var1: string | number; variable 11 num = typeof var1 === "string" && var1.length; // string 23 num = typeof var1 === "string" && var1.length; // string 35 num = typeof var1 === "string" && var1.length; // string 47 num = typeof var1 === "string" && var1.length; // string 59 num = typeof var1 === "string" && var1.length; // string 76 var var1; variable 80 num = typeof var1 === "string" && var1.length; // string 90 num = typeof var1 === "string" && var1.length; // string 100 num = typeof var1 === "string" && var1.length; // string [all …]
|
D | typeGuardConstructorPrimitiveTypes.symbols | 3 let var1: string | number | boolean | any[] | symbol | bigint; 4 >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) 6 if (var1.constructor === String) { 7 >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) 8 >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) 12 var1; // string 13 >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) 15 if (var1.constructor === Number) { 16 >var1.constructor : Symbol(Object.constructor, Decl(lib.es5.d.ts, --, --)) 17 >var1 : Symbol(var1, Decl(typeGuardConstructorPrimitiveTypes.ts, 1, 3)) [all …]
|
D | typeGuardsInClassAccessors.symbols | 12 var var1: string | number; 13 >var1 : Symbol(var1, Decl(typeGuardsInClassAccessors.ts, 6, 3)) 23 num = typeof var1 === "string" && var1.length; // string 25 >var1 : Symbol(var1, Decl(typeGuardsInClassAccessors.ts, 6, 3)) 26 >var1.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) 27 >var1 : Symbol(var1, Decl(typeGuardsInClassAccessors.ts, 6, 3)) 50 num = typeof var1 === "string" && var1.length; // string 52 >var1 : Symbol(var1, Decl(typeGuardsInClassAccessors.ts, 6, 3)) 53 >var1.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) 54 >var1 : Symbol(var1, Decl(typeGuardsInClassAccessors.ts, 6, 3)) [all …]
|
D | typeGuardsInModule.types | 12 var var1: string | number; 13 >var1 : string | number 20 num = typeof var1 === "string" && var1.length; // string 21 >num = typeof var1 === "string" && var1.length : number 23 >typeof var1 === "string" && var1.length : number 24 >typeof var1 === "string" : boolean 25 >typeof var1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "fu… 26 >var1 : string | number 28 >var1.length : number 29 >var1 : string [all …]
|
D | typeGuardsObjectMethods.types | 12 var var1: string | number; 13 >var1 : string | number 17 …var1 === "string" && var1.length; // string // variables in function declaration var… 25 num = typeof var1 === "string" && var1.length; // string 26 >num = typeof var1 === "string" && var1.length : number 28 >typeof var1 === "string" && var1.length : number 29 >typeof var1 === "string" : boolean 30 >typeof var1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "fu… 31 >var1 : string | number 33 >var1.length : number [all …]
|
D | typeGuardsInFunction.js | 7 var var1: string | number; variable 11 num = typeof var1 === "string" && var1.length; // string 25 num = typeof var1 === "string" && var1.length; // string 46 num = typeof var1 === "string" && var1.length; // string 67 num = typeof var1 === "string" && var1.length; // string 95 var var1; variable 99 num = typeof var1 === "string" && var1.length; // string 111 num = typeof var1 === "string" && var1.length; // string 129 num = typeof var1 === "string" && var1.length; // string 147 num = typeof var1 === "string" && var1.length; // string
|
/third_party/typescript/tests/cases/compiler/ |
D | typeGuardConstructorClassAndNumber.ts | 6 let var1: C1 | number; variable 7 if (var1.constructor == C1) { 8 var1; // C1 9 var1.property1; // string 12 var1; // number | C1 14 if (var1["constructor"] == C1) { 15 var1; // C1 16 var1.property1; // string 19 var1; // number | C1 21 if (var1.constructor === C1) { [all …]
|
D | typeGuardConstructorNarrowAny.ts | 4 let var1: any; variable 6 if (var1.constructor === String) { 7 var1; // String 9 if (var1.constructor === Number) { 10 var1; // Number 12 if (var1.constructor === Boolean) { 13 var1; // Boolean 15 if (var1.constructor === Array) { 16 var1; // any[] 18 if (var1.constructor === Symbol) { [all …]
|
D | typeGuardConstructorPrimitiveTypes.ts | 4 let var1: string | number | boolean | any[] | symbol | bigint; variable 5 if (var1.constructor === String) { 6 var1; // string 8 if (var1.constructor === Number) { 9 var1; // number 11 if (var1.constructor === Boolean) { 12 var1; // boolean 14 if (var1.constructor === Array) { 15 var1; // any[] 17 if (var1.constructor === Symbol) { [all …]
|
/third_party/typescript/tests/cases/conformance/expressions/typeGuards/ |
D | typeGuardsInClassAccessors.ts | 9 var var1: string | number; variable 14 num = typeof var1 === "string" && var1.length; // string 25 num = typeof var1 === "string" && var1.length; // string 37 num = typeof var1 === "string" && var1.length; // string 48 num = typeof var1 === "string" && var1.length; // string 60 num = typeof var1 === "string" && var1.length; // string 71 num = typeof var1 === "string" && var1.length; // string 83 num = typeof var1 === "string" && var1.length; // string 94 num = typeof var1 === "string" && var1.length; // string
|