@@ -466,8 +466,10 @@ cls.JsSourceView = function(id, name, container_class)
466466
467467 line_no_end || ( line_no_end = line_no_start ) ;
468468 this . showLine ( script_id , line_no_start ) ;
469- this . _change_highlight_class_lines ( "addClass" , line_no_start , line_no_end ) ;
470- var cb = this . _change_highlight_class_lines . bind ( this , "removeClass" ,
469+ this . _change_highlight_class_lines ( Element . prototype . addClass ,
470+ line_no_start , line_no_end ) ;
471+ var cb = this . _change_highlight_class_lines . bind ( this ,
472+ Element . prototype . removeClass ,
471473 line_no_start , line_no_end ) ;
472474 setTimeout ( cb , 1000 ) ;
473475 } ;
@@ -477,7 +479,7 @@ cls.JsSourceView = function(id, name, container_class)
477479 for ( var i = start , line ; i <= end ; i ++ )
478480 {
479481 if ( line = this . get_line_element ( i ) )
480- line [ method ] ( "selected-js-source-line" ) ;
482+ method . call ( line , "selected-js-source-line" ) ;
481483 }
482484 } ;
483485
@@ -511,11 +513,10 @@ cls.JsSourceView = function(id, name, container_class)
511513 this . showLine = function ( script_id , line_no , is_parse_error , is_scroll )
512514 {
513515 if ( __timeout_clear_view )
514- {
515516 __timeout_clear_view = clearTimeout ( __timeout_clear_view ) ;
516- }
517517
518- var is_visible = ( source_content = document . querySelector ( CONTAINER_SELECTOR ) ) ? true : false ;
518+ source_content = document . querySelector ( CONTAINER_SELECTOR ) ;
519+ var is_visible = Boolean ( source_content ) ;
519520 // if the view is visible it shows the first new script
520521 // before any parse error, that means in case of a parse error
521522 // the current script has not set the parse_error property
@@ -804,7 +805,8 @@ cls.JsSourceView = function(id, name, container_class)
804805
805806 var __clearView = function ( )
806807 {
807- if ( ( source_content = document . querySelector ( CONTAINER_SELECTOR ) ) && source_content . parentElement )
808+ source_content = document . querySelector ( CONTAINER_SELECTOR ) ;
809+ if ( source_content && source_content . parentElement )
808810 {
809811 var
810812 divs = source_content . parentElement . parentElement . getElementsByTagName ( 'div' ) ,
@@ -1031,6 +1033,7 @@ cls.JsSourceView.update_breakpoints = function(script, line_numbers, top_line)
10311033 var span = line_numbers . querySelector ( ".line-number" ) ;
10321034 top_line = span && Number ( span . textContent ) ;
10331035 }
1036+
10341037 if ( lines && bp_states && typeof top_line == "number" )
10351038 {
10361039 for ( var i = 0 , line ; line = lines [ i ] ; i ++ )
0 commit comments