1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
=== tests/cases/conformance/statements/throwStatements/throwInEnclosingStatements.ts ===
function fn(x) {
>fn : (x: any) => void
>x : any
throw x;
>x : any
}
<T>(x: T) => { throw x; }
><T>(x: T) => { throw x; } : <T>(x: T) => never
>x : T
>x : T
var y: string;
>y : string
switch (y) {
>y : string
case 'a':
>'a' : "a"
throw y;
>y : "a"
default:
throw y;
>y : string
}
var z = 0;
>z : number
>0 : 0
while (z < 10) {
>z < 10 : boolean
>z : number
>10 : 10
throw z;
>z : number
}
for (var i = 0; ;) { throw i; }
>i : number
>0 : 0
>i : number
for (var idx in {}) { throw idx; }
>idx : string
>{} : {}
>idx : string
do { throw null; }while(true)
>null : null
>true : true
var j = 0;
>j : number
>0 : 0
while (j < 0) { throw j; }
>j < 0 : boolean
>j : number
>0 : 0
>j : number
class C<T> {
>C : C<T>
private value: T;
>value : T
biz() {
>biz : () => void
throw this.value;
>this.value : T
>this : this
>value : T
}
constructor() {
throw this;
>this : this
}
}
var aa = {
>aa : { id: number; biz(): never; }
>{ id:12, biz() { throw this; }} : { id: number; biz(): never; }
id:12,
>id : number
>12 : 12
biz() {
>biz : () => never
throw this;
>this : any
}
}
|