diff --git a/packages/redux-devtools-instrument/src/instrument.js b/packages/redux-devtools-instrument/src/instrument.js index ff61c0f8..ac199cbb 100644 --- a/packages/redux-devtools-instrument/src/instrument.js +++ b/packages/redux-devtools-instrument/src/instrument.js @@ -80,7 +80,7 @@ export const ActionCreators = { stack = frames .slice( 0, - traceLimit + extraFrames + (frames[0] === 'Error' ? 1 : 0) + traceLimit + extraFrames + (frames[0].startsWith('Error') ? 1 : 0) ) .join('\n'); } diff --git a/packages/redux-devtools-instrument/test/instrument.spec.js b/packages/redux-devtools-instrument/test/instrument.spec.js index b5537e99..f2adf89a 100644 --- a/packages/redux-devtools-instrument/test/instrument.spec.js +++ b/packages/redux-devtools-instrument/test/instrument.spec.js @@ -827,10 +827,9 @@ describe('instrument', () => { exportedState = monitoredLiftedStore.getState(); expect(exportedState.actionsById[0].stack).toBe(undefined); expect(typeof exportedState.actionsById[1].stack).toBe('string'); - expect(exportedState.actionsById[1].stack).toMatch(/\bat dispatch\b/); expect(exportedState.actionsById[1].stack).toMatch(/\bfn1\b/); expect(exportedState.actionsById[1].stack).toMatch(/\bfn2\b/); - expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn3\b/); + expect(exportedState.actionsById[1].stack).toMatch(/\bfn3\b/); expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn4\b/); expect(exportedState.actionsById[1].stack).toContain( 'instrument.spec.js' @@ -865,10 +864,9 @@ describe('instrument', () => { exportedState = monitoredLiftedStore.getState(); expect(exportedState.actionsById[0].stack).toBe(undefined); expect(typeof exportedState.actionsById[1].stack).toBe('string'); - expect(exportedState.actionsById[1].stack).toMatch(/\bat dispatch\b/); expect(exportedState.actionsById[1].stack).toMatch(/\bfn1\b/); expect(exportedState.actionsById[1].stack).toMatch(/\bfn2\b/); - expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn3\b/); + expect(exportedState.actionsById[1].stack).toMatch(/\bfn3\b/); expect(exportedState.actionsById[1].stack).not.toMatch(/\bfn4\b/); expect(exportedState.actionsById[1].stack).toContain( 'instrument.spec.js' @@ -985,7 +983,7 @@ describe('instrument', () => { exportedState = monitoredLiftedStore.getState(); expect(exportedState.actionsById[0].stack).toBe(undefined); expect(typeof exportedState.actionsById[1].stack).toBe('string'); - expect(exportedState.actionsById[1].stack).toContain('at performAction'); + expect(exportedState.actionsById[1].stack).toContain('at Object.performAction'); expect(exportedState.actionsById[1].stack).toContain('instrument.js'); expect(exportedState.actionsById[1].stack).toContain( 'instrument.spec.js' @@ -1007,7 +1005,7 @@ describe('instrument', () => { expect(exportedState.actionsById[0].stack).toBe(undefined); expect(typeof exportedState.actionsById[1].stack).toBe('string'); expect(exportedState.actionsById[1].stack).toContain( - 'at performAction' + 'at Object.performAction' ); expect(exportedState.actionsById[1].stack).toContain('instrument.js'); expect(exportedState.actionsById[1].stack).toContain(