debugger icon indicating copy to clipboard operation
debugger copied to clipboard

Cant access this context after promise return

Open roqueorts opened this issue 6 years ago • 1 comments

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

roqueorts avatar Nov 02 '20 09:11 roqueorts

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

janodvarko avatar Mar 01 '21 13:03 janodvarko