@@ -10,16 +10,16 @@ import { isException } from "../../utils/pause";
1010import { connect } from "react-redux" ;
1111import {
1212 getVisibleSelectedFrame ,
13- getPause ,
13+ getPauseReason ,
1414 getSelectedSource
1515} from "../../selectors" ;
1616
17- import type { Frame , Pause } from "debugger-html" ;
17+ import type { Frame , Why } from "debugger-html" ;
1818import type { SourceRecord } from "../../reducers/types" ;
1919
2020type Props = {
2121 selectedFrame : Frame ,
22- pauseInfo : Pause ,
22+ why : Why ,
2323 selectedSource : SourceRecord
2424} ;
2525
@@ -40,33 +40,29 @@ export class DebugLine extends Component<Props> {
4040 debugExpression : null ;
4141
4242 componentDidUpdate ( prevProps : Props ) {
43- const { pauseInfo , selectedFrame, selectedSource } = this . props ;
44- this . setDebugLine ( pauseInfo , selectedFrame , selectedSource ) ;
43+ const { why , selectedFrame, selectedSource } = this . props ;
44+ this . setDebugLine ( why , selectedFrame , selectedSource ) ;
4545 }
4646
4747 componentWillUpdate ( ) {
48- const { pauseInfo , selectedFrame, selectedSource } = this . props ;
49- this . clearDebugLine ( selectedFrame , selectedSource , pauseInfo ) ;
48+ const { why , selectedFrame, selectedSource } = this . props ;
49+ this . clearDebugLine ( selectedFrame , selectedSource , why ) ;
5050 }
5151
5252 componentDidMount ( ) {
53- const { pauseInfo , selectedFrame, selectedSource } = this . props ;
54- this . setDebugLine ( pauseInfo , selectedFrame , selectedSource ) ;
53+ const { why , selectedFrame, selectedSource } = this . props ;
54+ this . setDebugLine ( why , selectedFrame , selectedSource ) ;
5555 }
5656
57- setDebugLine (
58- pauseInfo : Pause ,
59- selectedFrame : Frame ,
60- selectedSource : SourceRecord
61- ) {
57+ setDebugLine ( why : Why , selectedFrame : Frame , selectedSource : SourceRecord ) {
6258 if ( ! isDocumentReady ( selectedSource , selectedFrame ) ) {
6359 return ;
6460 }
6561 const sourceId = selectedFrame . location . sourceId ;
6662 const doc = getDocument ( sourceId ) ;
6763
6864 const { line, column } = toEditorPosition ( selectedFrame . location ) ;
69- const { markTextClass, lineClass } = this . getTextClasses ( pauseInfo ) ;
65+ const { markTextClass, lineClass } = this . getTextClasses ( why ) ;
7066 doc . addLineClass ( line , "line" , lineClass ) ;
7167
7268 this . debugExpression = doc . markText (
@@ -76,11 +72,7 @@ export class DebugLine extends Component<Props> {
7672 ) ;
7773 }
7874
79- clearDebugLine (
80- selectedFrame : Frame ,
81- selectedSource : SourceRecord ,
82- pause : Pause
83- ) {
75+ clearDebugLine ( selectedFrame : Frame , selectedSource : SourceRecord , why : Why ) {
8476 if ( ! isDocumentReady ( selectedSource , selectedFrame ) ) {
8577 return ;
8678 }
@@ -92,12 +84,12 @@ export class DebugLine extends Component<Props> {
9284 const sourceId = selectedFrame . location . sourceId ;
9385 const { line } = toEditorPosition ( selectedFrame . location ) ;
9486 const doc = getDocument ( sourceId ) ;
95- const { lineClass } = this . getTextClasses ( pause ) ;
87+ const { lineClass } = this . getTextClasses ( why ) ;
9688 doc . removeLineClass ( line , "line" , lineClass ) ;
9789 }
9890
99- getTextClasses ( pause : Pause ) : TextClasses {
100- if ( isException ( pause . why ) ) {
91+ getTextClasses ( why : Why ) : TextClasses {
92+ if ( isException ( why ) ) {
10193 return {
10294 markTextClass : "debug-expression-error" ,
10395 lineClass : "new-debug-line-error"
@@ -116,6 +108,6 @@ export default connect(state => {
116108 return {
117109 selectedFrame : getVisibleSelectedFrame ( state ) ,
118110 selectedSource : getSelectedSource ( state ) ,
119- pauseInfo : getPause ( state )
111+ why : getPauseReason ( state )
120112 } ;
121113} ) ( DebugLine ) ;
0 commit comments