@@ -14,11 +14,11 @@ import {
1414import assert from "../../utils/assert" ;
1515import { findClosestFunction } from "../../utils/ast" ;
1616
17- import type { Frame , ThreadId } from "../../types" ;
17+ import type { Frame , OriginalFrame , ThreadId } from "../../types" ;
1818import type { State } from "../../reducers/types" ;
1919import type { ThunkArgs } from "../types" ;
2020
21- import { isGeneratedId } from "devtools-source-map" ;
21+ import SourceMaps , { isGeneratedId } from "devtools-source-map" ;
2222
2323function isFrameBlackboxed ( state , frame ) {
2424const source = getSource ( state , frame . location . sourceId ) ;
@@ -35,7 +35,10 @@ function getSelectedFrameId(state, thread, frames) {
3535return selectedFrame && selectedFrame . id ;
3636}
3737
38- export function updateFrameLocation ( frame :Frame , sourceMaps :any ) {
38+ export function updateFrameLocation (
39+ frame :Frame ,
40+ sourceMaps :typeof SourceMaps
41+ ) {
3942if ( frame . isOriginal ) {
4043return Promise . resolve ( frame ) ;
4144}
@@ -48,7 +51,7 @@ export function updateFrameLocation(frame: Frame, sourceMaps: any) {
4851
4952function updateFrameLocations (
5053frames :Frame [ ] ,
51- sourceMaps :any
54+ sourceMaps :typeof SourceMaps
5255) :Promise < Frame [ ] > {
5356if ( ! frames || frames . length == 0 ) {
5457return Promise . resolve ( frames ) ;
@@ -104,7 +107,7 @@ function isWasmOriginalSourceFrame(frame, getState: () => State): boolean {
104107
105108async function expandFrames (
106109frames :Frame [ ] ,
107- sourceMaps :any ,
110+ sourceMaps :typeof SourceMaps ,
108111getState :( ) = > State
109112) :Promise < Frame [ ] > {
110113const result= [ ] ;
@@ -114,9 +117,9 @@ async function expandFrames(
114117result . push ( frame ) ;
115118continue ;
116119}
117- const originalFrames = await sourceMaps . getOriginalStackFrames (
118- frame . generatedLocation
119- ) ;
120+ const originalFrames : ? Array <
121+ OriginalFrame
122+ > = await sourceMaps . getOriginalStackFrames ( frame . generatedLocation ) ;
120123if ( ! originalFrames ) {
121124result . push ( frame ) ;
122125continue ;
@@ -130,6 +133,10 @@ async function expandFrames(
130133} ;
131134
132135originalFrames . forEach ( ( originalFrame , j ) => {
136+ if ( ! originalFrame . location || ! originalFrame . thread ) {
137+ return ;
138+ }
139+
133140// Keep outer most frame with true actor ID, and generate uniquie
134141// one for the nested frames.
135142const id = j == 0 ?frame . id :`${ frame . id } -originalFrame${ j } ` ;