|
| 1 | +=== tests/cases/compiler/noCrashOnThisTypeUsage.ts === |
| 2 | +interface IListenable { |
| 3 | +>IListenable : Symbol(IListenable, Decl(noCrashOnThisTypeUsage.ts, 0, 0)) |
| 4 | + |
| 5 | + changeListeners: Function[] | null |
| 6 | +>changeListeners : Symbol(IListenable.changeListeners, Decl(noCrashOnThisTypeUsage.ts, 0, 23)) |
| 7 | +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 8 | + |
| 9 | + observe(handler: (change: any, oldValue?: any) => void, fireImmediately?: boolean): void |
| 10 | +>observe : Symbol(IListenable.observe, Decl(noCrashOnThisTypeUsage.ts, 1, 38)) |
| 11 | +>handler : Symbol(handler, Decl(noCrashOnThisTypeUsage.ts, 2, 12)) |
| 12 | +>change : Symbol(change, Decl(noCrashOnThisTypeUsage.ts, 2, 22)) |
| 13 | +>oldValue : Symbol(oldValue, Decl(noCrashOnThisTypeUsage.ts, 2, 34)) |
| 14 | +>fireImmediately : Symbol(fireImmediately, Decl(noCrashOnThisTypeUsage.ts, 2, 59)) |
| 15 | +} |
| 16 | + |
| 17 | +function notifyListeners<T>(listenable: IListenable, change: T) { |
| 18 | +>notifyListeners : Symbol(notifyListeners, Decl(noCrashOnThisTypeUsage.ts, 3, 1)) |
| 19 | +>T : Symbol(T, Decl(noCrashOnThisTypeUsage.ts, 5, 25)) |
| 20 | +>listenable : Symbol(listenable, Decl(noCrashOnThisTypeUsage.ts, 5, 28)) |
| 21 | +>IListenable : Symbol(IListenable, Decl(noCrashOnThisTypeUsage.ts, 0, 0)) |
| 22 | +>change : Symbol(change, Decl(noCrashOnThisTypeUsage.ts, 5, 52)) |
| 23 | +>T : Symbol(T, Decl(noCrashOnThisTypeUsage.ts, 5, 25)) |
| 24 | +} |
| 25 | + |
| 26 | +export class ObservableValue<T> { |
| 27 | +>ObservableValue : Symbol(ObservableValue, Decl(noCrashOnThisTypeUsage.ts, 6, 1)) |
| 28 | +>T : Symbol(T, Decl(noCrashOnThisTypeUsage.ts, 8, 29)) |
| 29 | + |
| 30 | + constructor( |
| 31 | + public value: T |
| 32 | +>value : Symbol(ObservableValue.value, Decl(noCrashOnThisTypeUsage.ts, 9, 16)) |
| 33 | +>T : Symbol(T, Decl(noCrashOnThisTypeUsage.ts, 8, 29)) |
| 34 | + |
| 35 | + ) { |
| 36 | + const newValue: T = value; |
| 37 | +>newValue : Symbol(newValue, Decl(noCrashOnThisTypeUsage.ts, 12, 13)) |
| 38 | +>T : Symbol(T, Decl(noCrashOnThisTypeUsage.ts, 8, 29)) |
| 39 | +>value : Symbol(value, Decl(noCrashOnThisTypeUsage.ts, 9, 16)) |
| 40 | + |
| 41 | + const oldValue: any = null; |
| 42 | +>oldValue : Symbol(oldValue, Decl(noCrashOnThisTypeUsage.ts, 13, 13)) |
| 43 | + |
| 44 | + notifyListeners(this, { |
| 45 | +>notifyListeners : Symbol(notifyListeners, Decl(noCrashOnThisTypeUsage.ts, 3, 1)) |
| 46 | +>this : Symbol(ObservableValue, Decl(noCrashOnThisTypeUsage.ts, 6, 1)) |
| 47 | + |
| 48 | + type: "update", |
| 49 | +>type : Symbol(type, Decl(noCrashOnThisTypeUsage.ts, 14, 31)) |
| 50 | + |
| 51 | + object: this, |
| 52 | +>object : Symbol(object, Decl(noCrashOnThisTypeUsage.ts, 15, 27)) |
| 53 | +>this : Symbol(ObservableValue, Decl(noCrashOnThisTypeUsage.ts, 6, 1)) |
| 54 | + |
| 55 | + newValue, |
| 56 | +>newValue : Symbol(newValue, Decl(noCrashOnThisTypeUsage.ts, 16, 25)) |
| 57 | + |
| 58 | + oldValue |
| 59 | +>oldValue : Symbol(oldValue, Decl(noCrashOnThisTypeUsage.ts, 17, 21)) |
| 60 | + |
| 61 | + }); |
| 62 | + } |
| 63 | + changeListeners: Function[] | null = []; |
| 64 | +>changeListeners : Symbol(ObservableValue.changeListeners, Decl(noCrashOnThisTypeUsage.ts, 20, 5)) |
| 65 | +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) |
| 66 | + |
| 67 | + observe(handler: (change: any, oldValue?: any) => void, fireImmediately?: boolean) {} |
| 68 | +>observe : Symbol(ObservableValue.observe, Decl(noCrashOnThisTypeUsage.ts, 21, 44)) |
| 69 | +>handler : Symbol(handler, Decl(noCrashOnThisTypeUsage.ts, 22, 12)) |
| 70 | +>change : Symbol(change, Decl(noCrashOnThisTypeUsage.ts, 22, 22)) |
| 71 | +>oldValue : Symbol(oldValue, Decl(noCrashOnThisTypeUsage.ts, 22, 34)) |
| 72 | +>fireImmediately : Symbol(fireImmediately, Decl(noCrashOnThisTypeUsage.ts, 22, 59)) |
| 73 | +} |
0 commit comments