@@ -49,7 +49,7 @@ type Props = {|
4949 contextSize : number ,
5050 critical : boolean ,
5151 showCode : boolean ,
52- openInEditor : ( errorLoc : ErrorLocation ) => void ,
52+ editorHandler : ( errorLoc : ErrorLocation ) => void ,
5353| } ;
5454
5555type State = { |
@@ -85,17 +85,17 @@ class StackFrame extends Component<Props, State> {
8585 return { fileName , lineNumber : lineNumber || 1 } ;
8686 }
8787
88- openInEditor = ( ) => {
88+ editorHandler = ( ) => {
8989 const errorLoc = this . getErrorLocation ( ) ;
9090 if ( ! errorLoc ) {
9191 return ;
9292 }
93- this . props . openInEditor ( errorLoc ) ;
93+ this . props . editorHandler ( errorLoc ) ;
9494 } ;
9595
9696 onKeyDown = ( e : SyntheticKeyboardEvent < > ) => {
9797 if ( e . key === 'Enter' ) {
98- this . openInEditor ( ) ;
98+ this . editorHandler ( ) ;
9999 }
100100 } ;
101101
@@ -155,14 +155,15 @@ class StackFrame extends Component<Props, State> {
155155 }
156156 }
157157
158- const canOpenInEditor = this . getErrorLocation ( ) !== null ;
158+ const canOpenInEditor =
159+ this . getErrorLocation ( ) !== null && this . props . editorHandler !== null ;
159160 return (
160161 < div >
161162 < div > { functionName } </ div >
162163 < div style = { linkStyle } >
163164 < a
164165 style = { canOpenInEditor ? anchorStyle : null }
165- onClick = { canOpenInEditor ? this . openInEditor : null }
166+ onClick = { canOpenInEditor ? this . editorHandler : null }
166167 onKeyDown = { canOpenInEditor ? this . onKeyDown : null }
167168 tabIndex = { canOpenInEditor ? '0' : null }
168169 >
@@ -172,7 +173,7 @@ class StackFrame extends Component<Props, State> {
172173 { codeBlockProps && (
173174 < span >
174175 < a
175- onClick = { canOpenInEditor ? this . openInEditor : null }
176+ onClick = { canOpenInEditor ? this . editorHandler : null }
176177 style = { canOpenInEditor ? codeAnchorStyle : null }
177178 >
178179 < CodeBlock { ...codeBlockProps } />
0 commit comments