debugger
debugger copied to clipboard
Cant access this context after promise return
Hi, I would like to know why i cant see on the debugger the context 'this' object. It is as undefined on firefox debugger, but it appears on chrome debugger.
The code of my ts file is:
export class MYClass {
refresData(): void {
this.myService.getFunction(1)
.then(result => {
this.myProperty = result; // This object appears as undefined
}
}
}
The code of service:
async getFunction(id: number): Promise<MyObject> {
return of({...}).toPromise();
}
Version 82.0.2 (64-bit) on Windows 10
Cloned into Bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=1695642
Firefox Developer Tools (including Debugger tool) development is now entirely happening in Bugzilla and new issues should be reported here: https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Debugger
Honza